diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9682fcb5..4c1bf2b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,10 +38,11 @@ jobs: run: cd azure_devops_rust_api && cargo build --all-features - name: cleanup azure_devops_rust_api build artifacts run: rm -rf azure_devops_rust_api/target - - name: install wasm target - run: rustup target add wasm32-unknown-unknown - - name: azure_devops_rust_api check wasm build - run: cd azure_devops_rust_api && cargo check --target wasm32-unknown-unknown --all-features + # Remove wasm32 build due to issues with getrandom + #- name: install wasm target + # run: rustup target add wasm32-unknown-unknown + #- name: azure_devops_rust_api check wasm build + # run: cd azure_devops_rust_api && cargo check --target wasm32-unknown-unknown --all-features - name: azure_devops_rust_api test run: cd azure_devops_rust_api && cargo test - name: azure_devops_rust_api documentation generation diff --git a/CHANGELOG.md b/CHANGELOG.md index 77fdc534..6593fdbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,114 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +### Changes + +## [0.32.0] + +### Changes + +- Update `azure_core` and `azure_identity` to 0.28. +- Changes to handle API changes in `azure_core`: + - Replace `azure_core::http::RawResponse` with `azure_core::http::BufResponse` + - Add extra parameter when creating new `azure_core::http::Pipeline` +- Changes to handle API changes in `azure_identity`: + - Updated examples to replace `DefaultAzureCredential` with `AzureCliCredential` + +## [0.31.0] + +### Changes + +- Change `AgentPoolQueue` field to be optional: + - `name` +- Change `ProjectReference` field to be optional: + - `name` +- Change `ServiceEndpointProjectReference` fields to be optional: + - `description` + - `name` + +## [0.30.1] + +### Changes + +- Change `ServiceEndpoint` field to be optional: + - `description` +- Change `AgentPoolQueue` field to be optional: + - `pool` + +## [0.30.0] + +### Changes + +- Update `azure_core`, `azure_identity` to 0.27 +- Clippy fixes for `needless_lifetime` warnings. + +## [0.29.0] + +### Breaking changes + +- Update `azure_core`, `azure_identity` to 0.26 + - Some significant updates needed to handle changes to `azure_core::http::Response` + - `Response::into_raw_body()` renamed `Response::into_body()` + - `Response::into_raw_response()` now returns `azure_core::http::RawResponse` rather than `azure_core::http::Response` + - `Client::send()` now returns `azure_core::http::RawResponse` rather than `azure_core::http::Response` + - Fix up examples to work with response changes. +- Disable wasm32 CI build due to issues with `getrandom` + +## [0.28.0] + +### Changes + +- Update `azure_core`, `azure_identity` to 0.24 +- Fix formatting of date-time parameters + - Reapplying a previous fix that was lost + +## [0.27.0] + +### Changes + +- Update `azure_core`, `azure_identity` to 0.23 + - Update minimum rust-version to 1.80.0 (required by `azure_core`) + +## [0.26.1] + +### Changes + +- Add missing `completionOptions` field to `GitPullRequestUpdateOptions`. + +## [0.26.0] + +This is a significant change due to updating to the first offical releases of +`azure_core` (0.22) and `azure_identity` (0.22). These crates have a number of +breaking changes over previous versions. + +### Breaking changes +- Update `azure_core`, `azure_identity` to 0.22. +- `ClientBuilder::per_retry_policies()` renamed to `per_try_policies()` to align with + `azure_core` API naming. +- `Response::into_body()` renamed to `Response::into_raw_body()` to align with + `azure_core` API naming. +- Renamed crate features to align with `azure_core`: + - `enable_reqwest` => `reqwest` + - `enable_reqwest_rustls` => `reqwest_rustls` + +- Notes on changes to `azure_core` API: + - `Response::into_body()` is renamed `Response::into_raw_body()` +- Notes on changes to `azure_identity` API: + - The credential creation functions now return values wrapped in `Arc<_>`, + so you no longer need to do this in your client code. + - Example: `DefaultAzureCredential::new()` previously returned + `Result` but now returns a + `Result>`. + +## [0.25.0] + +### Breaking change +- Change git 'Change::item' field to be optional. + - Discovered that in some returned values this field is not present. + Any code accessing this field now needs to wrap it in an `Option`, or deal with the returned value being wrapped in an `Option`. + +### Changes - Clippy fixes for `needless_lifetime` warnings. ## [0.24.0] @@ -533,7 +641,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release. -[Unreleased]: https://github.com/microsoft/azure-devops-rust-api/compare/0.24.0...HEAD +[Unreleased]: https://github.com/microsoft/azure-devops-rust-api/compare/0.32.0...HEAD +[0.32.0]: https://github.com/microsoft/azure-devops-rust-api/compare/0.31.0...0.32.0 +[0.31.0]: https://github.com/microsoft/azure-devops-rust-api/compare/0.30.1...0.31.0 +[0.30.1]: https://github.com/microsoft/azure-devops-rust-api/compare/0.30.0...0.30.1 +[0.30.0]: https://github.com/microsoft/azure-devops-rust-api/compare/0.29.0...0.30.0 +[0.29.0]: https://github.com/microsoft/azure-devops-rust-api/compare/0.28.0...0.29.0 +[0.28.0]: https://github.com/microsoft/azure-devops-rust-api/compare/0.27.0...0.28.0 +[0.27.0]: https://github.com/microsoft/azure-devops-rust-api/compare/0.26.1...0.27.0 +[0.26.1]: https://github.com/microsoft/azure-devops-rust-api/compare/0.26.0...0.26.1 +[0.26.0]: https://github.com/microsoft/azure-devops-rust-api/compare/0.25.0...0.26.0 +[0.25.0]: https://github.com/microsoft/azure-devops-rust-api/compare/0.24.0...0.25.0 [0.24.0]: https://github.com/microsoft/azure-devops-rust-api/compare/0.23.0...0.24.0 [0.23.0]: https://github.com/microsoft/azure-devops-rust-api/compare/0.22.0...0.23.0 [0.22.0]: https://github.com/microsoft/azure-devops-rust-api/compare/0.21.1...0.22.0 diff --git a/autorust/Cargo.lock b/autorust/Cargo.lock index 72468972..ab5d52e4 100644 --- a/autorust/Cargo.lock +++ b/autorust/Cargo.lock @@ -1,21 +1,21 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "ado-autorust" @@ -91,9 +91,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" dependencies = [ "anstyle", "anstyle-parse", @@ -106,86 +106,85 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "once_cell_polyfill", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.83" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "askama" -version = "0.12.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" +checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4" dependencies = [ "askama_derive", - "askama_escape", - "humansize", - "num-traits", + "itoa", "percent-encoding", + "serde", + "serde_json", ] [[package]] name = "askama_derive" -version = "0.12.5" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" +checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f" dependencies = [ "askama_parser", "basic-toml", - "mime", - "mime_guess", + "memchr", "proc-macro2", "quote", + "rustc-hash", "serde", - "syn 2.0.90", + "serde_derive", + "syn 2.0.108", ] -[[package]] -name = "askama_escape" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" - [[package]] name = "askama_parser" -version = "0.2.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" +checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358" dependencies = [ - "nom", + "memchr", + "serde", + "serde_derive", + "winnow", ] [[package]] @@ -211,27 +210,27 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.2.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" dependencies = [ "concurrent-queue", - "event-listener 5.3.0", - "event-listener-strategy 0.5.2", + "event-listener-strategy", "futures-core", "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.11.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" +checksum = "bb812ffb58524bdd10860d7d974e2f01cc0950c2438a74ee5ec2e2280c6c4ffa" dependencies = [ "async-task", "concurrent-queue", - "fastrand 2.1.0", - "futures-lite 2.3.0", + "fastrand 2.3.0", + "futures-lite 2.6.0", + "pin-project-lite", "slab", ] @@ -241,89 +240,59 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel 2.2.1", + "async-channel 2.5.0", "async-executor", - "async-io 2.3.2", - "async-lock 3.3.0", + "async-io", + "async-lock", "blocking", - "futures-lite 2.3.0", + "futures-lite 2.6.0", "once_cell", ] [[package]] name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.3.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "19634d6336019ef220f09fd31168ce5c184b295cbf80345437cc36094ef223ca" dependencies = [ - "async-lock 3.3.0", + "async-lock", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.3.0", + "futures-lite 2.6.0", "parking", - "polling 3.7.0", - "rustix 0.38.34", + "polling", + "rustix", "slab", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", + "windows-sys 0.60.2", ] [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener 5.4.0", + "event-listener-strategy", "pin-project-lite", ] [[package]] name = "async-std" -version = "1.12.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +checksum = "730294c1c08c2e0f85759590518f6333f0d5a0a766a27d519c1b244c3dfd8a24" dependencies = [ "async-channel 1.9.0", "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", + "async-io", + "async-lock", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite 1.13.0", + "futures-lite 2.6.0", "gloo-timers", "kv-log-macro", "log", @@ -349,9 +318,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "autorust_codegen" @@ -375,8 +344,8 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "syn 2.0.90", - "thiserror 2.0.6", + "syn 2.0.108", + "thiserror 2.0.17", "toml", ] @@ -390,22 +359,22 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "thiserror 2.0.6", + "thiserror 2.0.17", ] [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -420,12 +389,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64" version = "0.22.1" @@ -434,9 +397,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "basic-toml" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" dependencies = [ "serde", ] @@ -473,9 +436,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "block-buffer" @@ -488,23 +451,22 @@ dependencies = [ [[package]] name = "blocking" -version = "1.6.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" dependencies = [ - "async-channel 2.2.1", - "async-lock 3.3.0", + "async-channel 2.5.0", "async-task", "futures-io", - "futures-lite 2.3.0", + "futures-lite 2.6.0", "piper", ] [[package]] name = "bon" -version = "3.2.0" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9276fe602371cd8a7f70fe68c4db55b2d3e92c570627d6ed0427646edfa5cf47" +checksum = "33d9ef19ae5263a138da9a86871eca537478ab0332a7770bac7e3f08b801f89f" dependencies = [ "bon-macros", "rustversion", @@ -512,9 +474,9 @@ dependencies = [ [[package]] name = "bon-macros" -version = "3.2.0" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94828b84b32b4f3ac3865f692fcdbc46c7d0dd87b29658a391d58a244e1ce45a" +checksum = "577ae008f2ca11ca7641bd44601002ee5ab49ef0af64846ce1ab6057218a5cc1" dependencies = [ "darling", "ident_case", @@ -522,32 +484,32 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.108", ] [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "bytes" -version = "1.6.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "camino" -version = "1.1.9" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "276a59bf2b2c967788139340c9f0c5b12d7fd6630315c15c217e559de85d2609" [[package]] name = "cargo_toml" -version = "0.21.0" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" +checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" dependencies = [ "serde", "toml", @@ -555,31 +517,33 @@ dependencies = [ [[package]] name = "caseless" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808dab3318747be122cb31d36de18d4d1c81277a76f8332a02b81a3d73463d7f" +checksum = "8b6fd507454086c8edfd769ca6ada439193cdb209c7681712ef6275cccbfe5d8" dependencies = [ - "regex", "unicode-normalization", ] [[package]] name = "cc" -version = "1.0.97" +version = "1.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "c3a42d84bb6b69d3a8b3eaacf0d88f179e1929695e1ad012b6cf64d9caaa5fd2" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "num-traits", "serde", @@ -596,9 +560,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.23" +version = "4.5.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623" dependencies = [ "clap_builder", "clap_derive", @@ -606,9 +570,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.23" +version = "4.5.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0" dependencies = [ "anstream", "anstyle", @@ -619,41 +583,40 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.108", ] [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "comrak" -version = "0.31.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453dcb42e33f7b474d7e0db12e0b8d82802c88f35cf5a1d8c297d0dfcecb154f" +checksum = "5ccfd7678fba9aff54a74a70352d952b345e568823ed9d5a92ebc8ad0adad8ea" dependencies = [ "bon", "caseless", "clap", "entities", + "fmt2io", "memchr", - "once_cell", - "regex", "shell-words", "slug", "syntect", @@ -673,9 +636,9 @@ dependencies = [ [[package]] name = "const_fn" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373e9fafaa20882876db20562275ff58d50e0caa2590077fe7ce7bef90211d0d" +checksum = "2f8a2ca5ac02d09563609681103aada9e1777d54fc57a5acd7a41404f9c93b6e" [[package]] name = "cookie" @@ -706,15 +669,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -727,9 +690,9 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "crates_io_api" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200ad30d24892baf2168f2df366939264d02f2fa0be0914f8e2da4bd3407c58c" +checksum = "b9d129ea9f4e6581cdda525c0b939e4b1753a9873543e4b409971b473f5c27db" dependencies = [ "chrono", "futures", @@ -744,18 +707,18 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-mac" @@ -778,9 +741,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "a79c4acb1fd5fa3d9304be4c76e031c54d2e92d172a393e24b19a14fe8532fe9" dependencies = [ "darling_core", "darling_macro", @@ -788,43 +751,43 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "74875de90daf30eb59609910b84d4d368103aaec4c924824c6799b28f77d6a1d" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.90", + "syn 2.0.108", ] [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "e79f8e61677d5df9167cd85265f8e5f64b215cdea3fb55eebc3e622e44c7a146" dependencies = [ "darling_core", "quote", - "syn 2.0.90", + "syn 2.0.108", ] [[package]] name = "deranged" -version = "0.3.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", ] [[package]] name = "deunicode" -version = "1.4.4" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322ef0094744e63628e6f0eb2295517f79276a5b342a4c2ff3042566ca181d4e" +checksum = "abd57806937c9cc163efc8ea3910e00a62e2aeb0b8119f1793a978088f8f6b04" [[package]] name = "digest" @@ -841,6 +804,17 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", +] + [[package]] name = "entities" version = "1.0.1" @@ -849,18 +823,18 @@ checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -871,20 +845,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.3.0" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" dependencies = [ "concurrent-queue", "parking", @@ -893,21 +856,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ - "event-listener 5.3.0", + "event-listener 5.4.0", "pin-project-lite", ] @@ -932,20 +885,26 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "flate2" -version = "1.0.30" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ "crc32fast", "miniz_oxide", ] +[[package]] +name = "fmt2io" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b6129284da9f7e5296cc22183a63f24300e945e297705dcc0672f7df01d62c8" + [[package]] name = "fnv" version = "1.0.7" @@ -978,9 +937,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -993,9 +952,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1003,15 +962,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1020,9 +979,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -1041,11 +1000,11 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ - "fastrand 2.1.0", + "fastrand 2.3.0", "futures-core", "futures-io", "parking", @@ -1054,32 +1013,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.108", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1116,13 +1075,25 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] @@ -1137,15 +1108,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gloo-timers" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" dependencies = [ "futures-channel", "futures-core", @@ -1155,9 +1126,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" [[package]] name = "heck" @@ -1167,9 +1138,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hkdf" @@ -1193,9 +1164,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -1204,9 +1175,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", @@ -1214,9 +1185,9 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", "futures-core", @@ -1249,24 +1220,15 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "humansize" -version = "2.1.3" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" -dependencies = [ - "libm", -] +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "hyper" -version = "1.3.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", @@ -1299,24 +1261,114 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" dependencies = [ + "base64 0.22.1", "bytes", "futures-channel", + "futures-core", "futures-util", "http", "http-body", "hyper", + "ipnet", + "libc", + "percent-encoding", "pin-project-lite", - "socket2 0.5.7", + "socket2", "tokio", - "tower", "tower-service", "tracing", ] +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1325,23 +1377,35 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] name = "indexmap" -version = "2.7.0" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" dependencies = [ "equivalent", "hashbrown", "serde", + "serde_core", ] [[package]] @@ -1352,48 +1416,59 @@ checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "io-uring" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" dependencies = [ - "hermit-abi", + "bitflags 2.9.1", + "cfg-if", "libc", - "windows-sys 0.48.0", ] [[package]] name = "ipnet" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "iri-string" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +dependencies = [ + "memchr", + "serde", +] [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -1406,29 +1481,11 @@ dependencies = [ "log", ] -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - [[package]] name = "libc" -version = "0.2.154" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" - -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "line-wrap" -version = "0.2.0" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd1bc4d24ad230d21fb898d1116b1801d7adfc449d42026475862ab48b11e70e" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "linked-hash-map" @@ -1438,80 +1495,57 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.3.8" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] -name = "linux-raw-sys" -version = "0.4.13" +name = "litemap" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "log" -version = "0.4.21" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" dependencies = [ "value-bag", ] [[package]] name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.11" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -1523,16 +1557,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "num-conv" version = "0.1.0" @@ -1548,38 +1572,34 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "object" -version = "0.32.2" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] name = "onig" -version = "6.4.0" +version = "6.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" +checksum = "336b9c63443aceef14bea841b899035ae3abe89b7c486aaf4c5bd8aafedac3f0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.9.1", "libc", "once_cell", "onig_sys", @@ -1587,9 +1607,9 @@ dependencies = [ [[package]] name = "onig_sys" -version = "69.8.1" +version = "69.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" +checksum = "c7f86c6eef3d6df15f23bcfb6af487cbd2fed4e5581d58d5bf1f5f8b7f6727dc" dependencies = [ "cc", "pkg-config", @@ -1603,11 +1623,11 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.9.1", "cfg-if", "foreign-types", "libc", @@ -1624,20 +1644,20 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.108", ] [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" dependencies = [ "cc", "libc", @@ -1647,9 +1667,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "path_abs" @@ -1669,31 +1689,11 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", -] - [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1703,64 +1703,46 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand 2.1.0", + "fastrand 2.3.0", "futures-io", ] [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "plist" -version = "1.6.1" +version = "1.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d34169e64b3c7a80c8621a48adaf44e0cf62c78a9b25dd9dd35f1881a17cf9" +checksum = "3af6b589e163c5a788fab00ce0c0366f6efbb9959c2f9874b224936af7fce7e1" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "indexmap", - "line-wrap", "quick-xml", "serde", - "time 0.3.36", -] - -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", + "time 0.3.41", ] [[package]] name = "polling" -version = "3.7.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "8ee9b2fa7a4517d2c91ff5bc6c297a427a96749d15f98fcdbb22c05571a4d4b7" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi", "pin-project-lite", - "rustix 0.38.34", - "tracing", - "windows-sys 0.52.0", + "rustix", + "windows-sys 0.60.2", ] [[package]] @@ -1774,6 +1756,15 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -1782,18 +1773,21 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "ff24dfcda44452b9816fff4cd4227e1bb73ff5a2f1bc1105aa92fb8565ce44d2" dependencies = [ "proc-macro2", - "syn 2.0.90", + "syn 2.0.108", ] [[package]] @@ -1804,9 +1798,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] @@ -1822,22 +1816,28 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.31.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +checksum = "8927b0664f5c5a98265138b7e3f90aa19a6b21353182469ace36d4ac527b7b1b" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "rand" version = "0.7.3" @@ -1897,7 +1897,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", ] [[package]] @@ -1911,9 +1911,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.1" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" dependencies = [ "aho-corasick", "memchr", @@ -1923,9 +1923,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "722166aa0d7438abbaa4d5cc2c649dac844e8c56d82fb3d33e9c34b5cd268fc6" dependencies = [ "aho-corasick", "memchr", @@ -1940,9 +1940,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.4" +version = "0.12.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531" dependencies = [ "base64 0.22.1", "bytes", @@ -1955,34 +1955,38 @@ dependencies = [ "hyper", "hyper-tls", "hyper-util", - "ipnet", "js-sys", "log", - "mime", "native-tls", - "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "tokio", "tokio-native-tls", + "tower", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg", ] [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustc_version" @@ -1995,58 +1999,37 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.34" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.9.1", "errno", "libc", - "linux-raw-sys 0.4.13", - "windows-sys 0.52.0", + "linux-raw-sys", + "windows-sys 0.60.2", ] [[package]] -name = "rustls-pemfile" -version = "2.1.2" +name = "rustls-pki-types" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" dependencies = [ - "base64 0.22.1", - "rustls-pki-types", + "zeroize", ] -[[package]] -name = "rustls-pki-types" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" - [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -2059,20 +2042,20 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.9.1", "core-foundation", "core-foundation-sys", "libc", @@ -2081,9 +2064,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -2106,41 +2089,52 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.215" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.108", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ "itoa", "memchr", "ryu", "serde", + "serde_core", ] [[package]] name = "serde_path_to_error" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" dependencies = [ "itoa", "serde", @@ -2159,11 +2153,11 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.7" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -2202,9 +2196,9 @@ dependencies = [ [[package]] name = "sha1_smol" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] name = "sha2" @@ -2225,20 +2219,23 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "slab" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" [[package]] name = "slug" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4" +checksum = "882a80f72ee45de3cc9a5afeb2da0331d58df69e4e7d8eeb5d3c7784ae67e724" dependencies = [ "deunicode", "wasm-bindgen", @@ -2246,29 +2243,25 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "socket2" -version = "0.4.10" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" dependencies = [ "libc", - "winapi", + "windows-sys 0.59.0", ] [[package]] -name = "socket2" -version = "0.5.7" +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "standback" @@ -2365,9 +2358,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" dependencies = [ "proc-macro2", "quote", @@ -2376,9 +2369,23 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", +] [[package]] name = "syntect" @@ -2405,23 +2412,24 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ - "cfg-if", - "fastrand 2.1.0", - "rustix 0.38.34", - "windows-sys 0.52.0", + "fastrand 2.3.0", + "getrandom 0.3.3", + "once_cell", + "rustix", + "windows-sys 0.59.0", ] [[package]] name = "terminal_size" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" dependencies = [ - "rustix 0.38.34", + "rustix", "windows-sys 0.59.0", ] @@ -2436,11 +2444,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.6" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ - "thiserror-impl 2.0.6", + "thiserror-impl 2.0.17", ] [[package]] @@ -2451,18 +2459,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.108", ] [[package]] name = "thiserror-impl" -version = "2.0.6" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.108", ] [[package]] @@ -2482,9 +2490,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", @@ -2492,14 +2500,14 @@ dependencies = [ "powerfmt", "serde", "time-core", - "time-macros 0.2.18", + "time-macros 0.2.22", ] [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" @@ -2513,9 +2521,9 @@ dependencies = [ [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", @@ -2534,11 +2542,21 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -2551,18 +2569,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.47.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" dependencies = [ "backtrace", "bytes", + "io-uring", "libc", "mio", - "num_cpus", "pin-project-lite", - "socket2 0.5.7", - "windows-sys 0.48.0", + "slab", + "socket2", + "windows-sys 0.59.0", ] [[package]] @@ -2577,82 +2596,103 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" dependencies = [ - "serde", + "indexmap", + "serde_core", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_parser", + "toml_writer", + "winnow", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" dependencies = [ - "serde", + "serde_core", ] [[package]] -name = "toml_edit" -version = "0.22.20" +name = "toml_parser" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", "winnow", ] +[[package]] +name = "toml_writer" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" + [[package]] name = "tower" -version = "0.4.13" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", - "pin-project", "pin-project-lite", + "sync_wrapper", "tokio", "tower-layer", "tower-service", - "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +dependencies = [ + "bitflags 2.9.1", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", ] [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ - "log", "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", ] @@ -2671,36 +2711,21 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] @@ -2729,9 +2754,9 @@ checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "url" -version = "2.5.0" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -2739,17 +2764,23 @@ dependencies = [ "serde", ] +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "value-bag" -version = "1.9.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" +checksum = "943ce29a8a743eb10d6082545d861b24f9d1b160b7d741e0f2cdf726bec909c5" [[package]] name = "vcpkg" @@ -2759,15 +2790,15 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "waker-fn" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" @@ -2796,52 +2827,63 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", + "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.108", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2849,28 +2891,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.108", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -2894,11 +2939,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2908,22 +2953,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" +name = "windows-link" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-sys" @@ -2935,18 +2968,12 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-sys" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets 0.53.3", ] [[package]] @@ -2958,7 +2985,7 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", @@ -2966,10 +2993,21 @@ dependencies = [ ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" +name = "windows-targets" +version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] [[package]] name = "windows_aarch64_gnullvm" @@ -2978,10 +3016,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" +name = "windows_aarch64_gnullvm" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" [[package]] name = "windows_aarch64_msvc" @@ -2990,10 +3028,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] -name = "windows_i686_gnu" -version = "0.48.5" +name = "windows_aarch64_msvc" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" [[package]] name = "windows_i686_gnu" @@ -3001,6 +3039,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" @@ -3008,10 +3052,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] -name = "windows_i686_msvc" -version = "0.48.5" +name = "windows_i686_gnullvm" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" [[package]] name = "windows_i686_msvc" @@ -3020,10 +3064,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" +name = "windows_i686_msvc" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" [[package]] name = "windows_x86_64_gnu" @@ -3032,10 +3076,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" +name = "windows_x86_64_gnu" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" [[package]] name = "windows_x86_64_gnullvm" @@ -3044,10 +3088,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" +name = "windows_x86_64_gnullvm" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" [[package]] name = "windows_x86_64_msvc" @@ -3055,25 +3099,36 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" -version = "0.6.18" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" dependencies = [ "memchr", ] [[package]] -name = "winreg" -version = "0.52.0" +name = "wit-bindgen-rt" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "cfg-if", - "windows-sys 0.48.0", + "bitflags 2.9.1", ] +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + [[package]] name = "xdg" version = "2.5.2" @@ -3088,3 +3143,107 @@ checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" dependencies = [ "linked-hash-map", ] + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", +] diff --git a/autorust/codegen/Cargo.toml b/autorust/codegen/Cargo.toml index bf2c0d09..0d70ae27 100644 --- a/autorust/codegen/Cargo.toml +++ b/autorust/codegen/Cargo.toml @@ -17,20 +17,20 @@ heck = "0.5" regex = "1" indexmap = { version = "2", features = ["serde"] } path_abs = "0.5" -comrak = "0.31" +comrak = "0.43" serde = "1" http-types = "2" once_cell = "1" syn = { version = "2", features = ["parsing"] } camino = "1" -askama = "0.12" -toml = "0.8" +askama = "0.14" +toml = "0.9" qstring = "0.7" -cargo_toml = "0.21" +cargo_toml = "0.22" [dev-dependencies] thiserror = "2" -crates_io_api = "0.11" +crates_io_api = "0.12" [lints] workspace = true diff --git a/autorust/codegen/src/codegen_models.rs b/autorust/codegen/src/codegen_models.rs index faf90877..0fdf272f 100644 --- a/autorust/codegen/src/codegen_models.rs +++ b/autorust/codegen/src/codegen_models.rs @@ -1166,7 +1166,7 @@ fn create_struct( serde.add_with("azure_core::date::rfc1123::option"); } else if type_name.is_vec() { serde.add_default(); - serde.add_deserialize_with("azure_core::util::deserialize_null_as_default"); + serde.add_deserialize_with("crate::serde::deserialize_null_as_default"); serde.add_skip_serializing_if("Vec::is_empty"); } else { serde.add_default(); diff --git a/autorust/codegen/src/codegen_operations/create_client_and_builder.rs b/autorust/codegen/src/codegen_operations/create_client_and_builder.rs index 5322b6cf..e0064390 100644 --- a/autorust/codegen/src/codegen_operations/create_client_and_builder.rs +++ b/autorust/codegen/src/codegen_operations/create_client_and_builder.rs @@ -34,18 +34,18 @@ pub fn create_client(modules: &[String], endpoint: Option<&str>) -> Result, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } #default_endpoint_code @@ -58,13 +58,13 @@ pub fn create_client(modules: &[String], endpoint: Option<&str>) -> Result) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -78,32 +78,32 @@ pub fn create_client(modules: &[String], endpoint: Option<&str>) -> Result) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] - pub fn per_call_policies(mut self, policies: impl Into>>) -> Self { - self.options = self.options.per_call_policies(policies); + pub fn per_call_policies(mut self, policies: impl Into>>) -> Self { + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } @@ -125,7 +125,7 @@ pub fn create_client(modules: &[String], endpoint: Option<&str>) -> Result &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -134,8 +134,8 @@ pub fn create_client(modules: &[String], endpoint: Option<&str>) -> Result Vec<&str> { self.scopes.iter().map(String::as_str).collect() } - pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { - let context = azure_core::Context::default(); + pub(crate) async fn send(&self, request: &mut azure_core::http::Request) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } @@ -147,14 +147,15 @@ pub fn create_client(modules: &[String], endpoint: Option<&str>) -> Result, credential: crate::Credential, scopes: Vec, options: azure_core::ClientOptions) -> Self { + pub fn new(endpoint: impl Into, credential: crate::Credential, scopes: Vec, options: azure_core::http::ClientOptions) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None ); Self { endpoint, diff --git a/autorust/codegen/src/codegen_operations/new_request_code.rs b/autorust/codegen/src/codegen_operations/new_request_code.rs index b41b5f21..8f88c0eb 100644 --- a/autorust/codegen/src/codegen_operations/new_request_code.rs +++ b/autorust/codegen/src/codegen_operations/new_request_code.rs @@ -3,7 +3,7 @@ use quote::{quote, ToTokens}; use crate::spec::WebVerb; -/// Calls `azure_core::Request::new` and set the authentication. +/// Calls `azure_core::http::Request::new` and set the authentication. pub struct NewRequestCode { pub auth: AuthCode, pub verb: WebVerb, @@ -15,7 +15,7 @@ impl ToTokens for NewRequestCode { let auth = &self.auth; let verb = verb_to_tokens(&self.verb); tokens.extend(quote! { - let mut req = azure_core::Request::new(url, #verb); + let mut req = azure_core::http::Request::new(url, #verb); #auth }) } @@ -31,7 +31,7 @@ impl ToTokens for AuthCode { tokens.extend(quote! { // Note: Changed for azure-devops-rust-api if let Some(auth_header) = this.client.token_credential().http_authorization_header(&this.client.scopes()).await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } }) } @@ -39,12 +39,12 @@ impl ToTokens for AuthCode { fn verb_to_tokens(verb: &WebVerb) -> TokenStream { match verb { - WebVerb::Get => quote! { azure_core::Method::Get }, - WebVerb::Post => quote! { azure_core::Method::Post }, - WebVerb::Put => quote! { azure_core::Method::Put }, - WebVerb::Patch => quote! { azure_core::Method::Patch }, - WebVerb::Delete => quote! { azure_core::Method::Delete }, - WebVerb::Options => quote! { azure_core::Method::Option }, - WebVerb::Head => quote! { azure_core::Method::Head }, + WebVerb::Get => quote! { azure_core::http::Method::Get }, + WebVerb::Post => quote! { azure_core::http::Method::Post }, + WebVerb::Put => quote! { azure_core::http::Method::Put }, + WebVerb::Patch => quote! { azure_core::http::Method::Patch }, + WebVerb::Delete => quote! { azure_core::http::Method::Delete }, + WebVerb::Options => quote! { azure_core::http::Method::Option }, + WebVerb::Head => quote! { azure_core::http::Method::Head }, } } diff --git a/autorust/codegen/src/codegen_operations/request_builder_into_future.rs b/autorust/codegen/src/codegen_operations/request_builder_into_future.rs index 1cbbb589..5ae4f502 100644 --- a/autorust/codegen/src/codegen_operations/request_builder_into_future.rs +++ b/autorust/codegen/src/codegen_operations/request_builder_into_future.rs @@ -64,32 +64,32 @@ impl ToTokens for RequestBuilderIntoFutureCode { let location = get_location(headers, FinalState::#final_state)?; if let Some(url) = location { loop { - let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get); + let mut req = azure_core::http::Request::new(url.clone(), azure_core::http::Method::Get); // Note: Changed for azure-devops-rust-api // let bearer_token = self.client.bearer_token().await?; - // req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret())); + // req.insert_header(azure_core::http::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret())); if let Some(auth_header) = this.client.token_credential().http_authorization_header(&this.client.scopes()).await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } let response = self.client.send(&mut req).await?; let headers = response.headers(); let retry_after = get_retry_after(headers); - let bytes = response.into_body().collect().await?; + let bytes: azure_core::Bytes = response.into_raw_body().collect().await?; let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| Error::message(ErrorKind::Other, "Long running operation failed (missing provisioning state)".to_string()) )?; log::trace!("current provisioning_state: {provisioning_state:?}"); match provisioning_state { LroStatus::Succeeded => { - let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get); + let mut req = azure_core::http::Request::new(self.url()?, azure_core::http::Method::Get); // Note: Changed for azure-devops-rust-api // let bearer_token = self.client.bearer_token().await?; - // req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret())); + // req.insert_header(azure_core::http::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret())); if let Some(auth_header) = this.client.token_credential().http_authorization_header(&this.client.scopes()).await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } let response = self.client.send(&mut req).await?; - return Response(response).into_body().await + return Response(response.into()).into_body().await } LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())), LroStatus::Canceled => return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string())), diff --git a/autorust/codegen/src/codegen_operations/request_builder_send.rs b/autorust/codegen/src/codegen_operations/request_builder_send.rs index baff0b69..1238e4b9 100644 --- a/autorust/codegen/src/codegen_operations/request_builder_send.rs +++ b/autorust/codegen/src/codegen_operations/request_builder_send.rs @@ -6,7 +6,9 @@ use crate::codegen::PARAM_RE; use crate::Result; use crate::{codegen::parse_path_params, identifier::SnakeCaseIdent}; -use super::{new_request_code::NewRequestCode, response_code::ResponseCode, set_request_code::SetRequestCode}; +use super::{ + new_request_code::NewRequestCode, response_code::ResponseCode, set_request_code::SetRequestCode, +}; /// The `send` function of the request builder. pub struct RequestBuilderSendCode { new_request_code: NewRequestCode, @@ -16,7 +18,11 @@ pub struct RequestBuilderSendCode { } impl RequestBuilderSendCode { - pub fn new(new_request_code: NewRequestCode, request_builder: SetRequestCode, response_code: ResponseCode) -> Result { + pub fn new( + new_request_code: NewRequestCode, + request_builder: SetRequestCode, + response_code: ResponseCode, + ) -> Result { let params = parse_path_params(&new_request_code.path); let url_args: Result> = params.iter().map(|s| s.to_snake_case_ident()).collect(); let url_args = url_args?; @@ -57,20 +63,20 @@ impl ToTokens for RequestBuilderSendCode { let urlfn = if self.request_builder.has_param_api_version { let api_version = &self.request_builder.api_version; quote! { - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!(#fpath, self.client.endpoint(), #url_str_args))?; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!(#fpath, self.client.endpoint(), #url_str_args))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut().append_pair(azure_core::query_param::API_VERSION, #api_version); + url.query_pairs_mut().append_pair(azure_core::http::headers::query_param::API_VERSION, #api_version); } Ok(url) } } } else { quote! { - fn url(http://github.com/&self) -> azure_core::Result { - let url = azure_core::Url::parse(&format!(#fpath, self.client.endpoint(), #url_str_args))?; + fn url(http://github.com/&self) -> azure_core::Result { + let url = azure_core::http::Url::parse(&format!(#fpath, self.client.endpoint(), #url_str_args))?; Ok(url) } } @@ -89,7 +95,7 @@ impl ToTokens for RequestBuilderSendCode { #new_request_code #request_builder req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } @@ -108,9 +114,9 @@ impl ToTokens for RequestBuilderSendCode { if request_builder.has_param_api_version { let api_version = &request_builder.api_version; stream_api_version.extend(quote! { - let has_api_version_already = req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + let has_api_version_already = req.url_mut().query_pairs().any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - req.url_mut().query_pairs_mut().append_pair(azure_core::query_param::API_VERSION, #api_version); + req.url_mut().query_pairs_mut().append_pair(azure_core::http::headers::query_param::API_VERSION, #api_version); } }); } @@ -118,15 +124,20 @@ impl ToTokens for RequestBuilderSendCode { if request_builder.has_param_x_ms_version { let api_version = &request_builder.api_version; stream_api_version.extend(quote! { - req.insert_header(azure_core::headers::VERSION, #api_version); + req.insert_header(azure_core::http::headers::VERSION, #api_version); }); } - let response_type = self.response_code.response_type().expect("pageable response has a body"); + let response_type = self + .response_code + .response_type() + .expect("pageable response has a body"); // some of the pageable requests specify the continuation token // as a parameter. In this case, use the basic request builder, // but insert the continuation parameter - if let Some(continuable_param) = get_continuable_param(next_link_name, request_builder) { + if let Some(continuable_param) = + get_continuable_param(next_link_name, request_builder) + { quote! { pub fn into_stream(self) -> azure_core::Pageable<#response_type, azure_core::error::Error> { let make_request = move |continuation: Option| { @@ -144,7 +155,7 @@ impl ToTokens for RequestBuilderSendCode { match rsp.status() { #match_status }; - rsp?.into_body().await + rsp?.into_raw_body().await } }; @@ -165,7 +176,7 @@ impl ToTokens for RequestBuilderSendCode { url = url.join(&value)?; #new_request_code #stream_api_version - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); this.client.send(&mut req).await? } diff --git a/autorust/codegen/src/codegen_operations/response_code.rs b/autorust/codegen/src/codegen_operations/response_code.rs index fecb60b2..c9486384 100644 --- a/autorust/codegen/src/codegen_operations/response_code.rs +++ b/autorust/codegen/src/codegen_operations/response_code.rs @@ -87,47 +87,54 @@ impl ResponseCode { impl ToTokens for ResponseCode { fn to_tokens(&self, tokens: &mut TokenStream) { + let (response_type_tokens, azure_core_response_tokens) = match self.response_type() { + Some(response_type) => { + if response_type.is_bytes() { + ( + quote! { Bytes }, + quote! { azure_core::http::Response }, + ) + } else if self.produces_xml() { + ( + quote! { #response_type }, + quote! { azure_core::http::Response<#response_type, azure_core::http::XmlFormat> }, + ) + } else { + ( + quote! { #response_type }, + quote! { azure_core::http::Response<#response_type, azure_core::http::JsonFormat> }, + ) + } + } + None => ( + quote! { () }, + quote! { azure_core::http::Response<(), azure_core::http::NoFormat> }, + ), + }; + tokens.extend(quote! { #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(#azure_core_response_tokens); }); - let body_fn = if let Some(response_type) = self.response_type() { - let deserialize_body = if response_type.is_bytes() { - quote! { - let body = bytes; - } - } else if self.produces_xml() { - quote! { - let body: #response_type = azure_core::xml::read_xml(&bytes)?; - } - } else { - quote! { - let body: #response_type = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - } - }; - let into_body = quote! { - pub async fn into_body(self) -> azure_core::Result<#response_type> { - let bytes = self.0.into_body().collect().await?; - #deserialize_body - Ok(body) + + let body_fn = if self.response_type().is_some() { + quote! { + pub async fn into_body(self) -> azure_core::Result<#response_type_tokens> { + self.0.into_body().await } - }; - into_body + } } else { quote! {} }; + let raw_response_fn = quote! { + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() + } + }; + let headers_fn = if self.headers.has_headers() { - quote! { pub fn headers(&self) -> Headers { Headers(self.0.headers()) } } + quote! { pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } } else { quote! {} }; @@ -135,24 +142,9 @@ impl ToTokens for ResponseCode { tokens.extend(quote! { impl Response { #body_fn - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } + #raw_response_fn #headers_fn } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } }); tokens.extend(self.headers.to_token_stream()); } diff --git a/autorust/codegen/src/codegen_operations/response_headers.rs b/autorust/codegen/src/codegen_operations/response_headers.rs index 154372f6..ff422272 100644 --- a/autorust/codegen/src/codegen_operations/response_headers.rs +++ b/autorust/codegen/src/codegen_operations/response_headers.rs @@ -60,25 +60,25 @@ impl ToTokens for HeaderCode { let hdr_fn = if type_name_code.is_string() { quote! { pub fn #function_name(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static(#header_name)) + self.0.get_str(&azure_core::http::headers::HeaderName::from_static(#header_name)) } } } else if type_name_code.is_date_time() { quote! { pub fn #function_name(&self) -> azure_core::Result { - crate::date_time::parse_rfc3339(self.0.get_str(&azure_core::headers::HeaderName::from_static(#header_name))?) + crate::date_time::parse_rfc3339(self.0.get_str(&azure_core::http::headers::HeaderName::from_static(#header_name))?) } } } else if type_name_code.is_date_time_rfc1123() { quote! { pub fn #function_name(&self) -> azure_core::Result { - azure_core::date::parse_rfc1123(self.0.get_str(&azure_core::headers::HeaderName::from_static(#header_name))?) + azure_core::date::parse_rfc1123(self.0.get_str(&azure_core::http::headers::HeaderName::from_static(#header_name))?) } } } else { quote! { pub fn #function_name(&self) -> azure_core::Result<#type_name_code> { - self.0.get_as(&azure_core::headers::HeaderName::from_static(#header_name)) + self.0.get_as(&azure_core::http::headers::HeaderName::from_static(#header_name)) } } }; @@ -109,7 +109,7 @@ impl ToTokens for HeadersCode { if self.has_headers() { let headers = &self.headers; tokens.extend(quote! { - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { #(#headers)* } diff --git a/autorust/codegen/src/codegen_operations/set_request_code.rs b/autorust/codegen/src/codegen_operations/set_request_code.rs index 05b9f92e..42a86898 100644 --- a/autorust/codegen/src/codegen_operations/set_request_code.rs +++ b/autorust/codegen/src/codegen_operations/set_request_code.rs @@ -3,7 +3,10 @@ use quote::{quote, ToTokens}; use crate::spec::WebVerb; -use super::{function_params::FunctionParams, set_request_param_code::SetRequestParamsCode, web_operation_gen::WebOperationGen}; +use super::{ + function_params::FunctionParams, set_request_param_code::SetRequestParamsCode, + web_operation_gen::WebOperationGen, +}; /// Set all body and parameters for the request. pub struct SetRequestCode { pub has_param_api_version: bool, @@ -35,7 +38,7 @@ impl ToTokens for SetRequestCode { if self.has_param_x_ms_version { let api_version = &self.api_version; tokens.extend(quote! { - req.insert_header(azure_core::headers::VERSION, #api_version); + req.insert_header(azure_core::http::headers::VERSION, #api_version); }); } @@ -48,14 +51,14 @@ impl ToTokens for SetRequestCode { if !self.has_body_parameter { tokens.extend(quote! { - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); }); } // if it is a post and there is no body, set the Content-Length to 0 if self.is_post && !self.has_body_parameter { tokens.extend(quote! { - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); }); } } diff --git a/autorust/codegen/src/codegen_operations/set_request_param_code.rs b/autorust/codegen/src/codegen_operations/set_request_param_code.rs index 547fd2f1..dbc0e3ee 100644 --- a/autorust/codegen/src/codegen_operations/set_request_param_code.rs +++ b/autorust/codegen/src/codegen_operations/set_request_param_code.rs @@ -51,6 +51,11 @@ impl ToTokens for SetRequestParamsCode { quote! { req.url_mut().query_pairs_mut().append_pair(#param_name, #param_name_var); } + } else if param.type_name.is_date_time() { + quote! { + let formatted_date_time = crate::date_time::format_date_time(#param_name_var)?; + req.url_mut().query_pairs_mut().append_pair(#param_name, &formatted_date_time); + } } else { quote! { req.url_mut().query_pairs_mut().append_pair(#param_name, &#param_name_var.to_string()); @@ -111,10 +116,12 @@ impl ToTokens for SetRequestParamsCode { // TODO: more work needs to be done to ensure we're using // the right encoder. - let encoder = if !self.params.has_content_type_header() && self.content_type.starts_with("application/xml") { + let encoder = if !self.params.has_content_type_header() + && self.content_type.starts_with("application/xml") + { quote! {azure_core::xml::to_xml} } else { - quote! { azure_core::to_json } + quote! { azure_core::json::to_json } }; if !param.is_optional() || is_vec { @@ -129,7 +136,7 @@ impl ToTokens for SetRequestParamsCode { #set_content_type #encoder(#param_name_var)? } else { - azure_core::EMPTY_BODY + azure_core::Bytes::new() }; }); } diff --git a/azure_devops_rust_api/Cargo.toml b/azure_devops_rust_api/Cargo.toml index 20347b4b..f6b7bdeb 100644 --- a/azure_devops_rust_api/Cargo.toml +++ b/azure_devops_rust_api/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "azure_devops_rust_api" -version = "0.24.0" +version = "0.32.0" edition = "2021" authors = ["John Batty "] description = "Rust API library for Azure DevOps" @@ -15,15 +15,13 @@ categories = ["api-bindings"] license = "MIT" readme = "README.md" publish = ["crates-io"] -# Require 1.64.0 for IntoFuture support -# https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#enhancing-await-with-intofuture -rust-version = "1.64.0" +rust-version = "1.80.0" [lib] doctest = false [dependencies] -azure_core = { version = "0.21", default-features = true } +azure_core = { version = "0.28", default-features = true } serde = { version = "1", features = ["derive"] } serde_json = "1" bytes = "1" @@ -34,16 +32,22 @@ async-trait = "0.1" tracing = "0.1" once_cell = "1" +# uuid is an indirect dependency that fails to build on wasm32. +# See: https://github.com/uuid-rs/uuid/issues/802 +# As a workaround, include it directly and enable the "js" feature. +[target.wasm32-unknown-unknown.dependencies] +uuid = { version = "1", features = ["serde", "v4", "js"] } + [dev-dependencies] -azure_identity = "0.21" +azure_identity = "0.28" tokio = { version = "1", features = ["full"] } anyhow = "1" tracing-subscriber = "0.3" [features] -default = ["enable_reqwest"] -enable_reqwest = ["azure_core/enable_reqwest"] -enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] +default = ["reqwest"] +reqwest = ["azure_core/reqwest"] +#reqwest_rustls = ["azure_core/reqwest_rustls"] no-default-tag = [] accounts = [] approvals_and_checks = [] diff --git a/azure_devops_rust_api/README.md b/azure_devops_rust_api/README.md index d5795f8e..af922af2 100644 --- a/azure_devops_rust_api/README.md +++ b/azure_devops_rust_api/README.md @@ -67,7 +67,7 @@ Example application `Cargo.toml` dependency spec showing how to specify desired ```toml [dependencies] ... -azure_devops_rust_api = { version = "0.23.0", features = ["git", "pipelines"] } +azure_devops_rust_api = { version = "0.32.0", features = ["git", "pipelines"] } ``` ## Examples diff --git a/azure_devops_rust_api/examples/artifact_provenance.rs b/azure_devops_rust_api/examples/artifact_provenance.rs index 895f5393..b0c86276 100644 --- a/azure_devops_rust_api/examples/artifact_provenance.rs +++ b/azure_devops_rust_api/examples/artifact_provenance.rs @@ -49,7 +49,7 @@ async fn main() -> Result<()> { .id .as_deref() .unwrap_or(""); - println!("{:30}{:40}{:40}", name, id, version_id); + println!("{name:30}{id:40}{version_id:40}"); let provenance = artifacts_client .artifact_details_client() @@ -63,7 +63,7 @@ async fn main() -> Result<()> { .await? .provenance; - println!("{:#?}", provenance); + println!("{provenance:#?}"); } } } diff --git a/azure_devops_rust_api/examples/artifacts_list.rs b/azure_devops_rust_api/examples/artifacts_list.rs index 3643e9f4..2774bc16 100644 --- a/azure_devops_rust_api/examples/artifacts_list.rs +++ b/azure_devops_rust_api/examples/artifacts_list.rs @@ -34,11 +34,11 @@ async fn main() -> Result<()> { let id = feed.feed_core.id.as_deref().unwrap_or(""); let name = feed.feed_core.name.as_deref().unwrap_or(""); let url = feed.url.as_deref().unwrap_or(""); - println!("{:40}{:30}{}", id, name, url); + println!("{id:40}{name:30}{url}"); } if let Some(feed) = feeds.first() { - println!("\nExample feed struct:\n{:#?}", feed); + println!("\nExample feed struct:\n{feed:#?}"); if let Some(feed_id) = &feed.feed_core.id { println!("\nFeed packages:"); @@ -52,7 +52,7 @@ async fn main() -> Result<()> { let id = package.id.as_deref().unwrap_or(""); let name = package.name.as_deref().unwrap_or(""); let url = package.url.as_deref().unwrap_or(""); - println!("{:40}{:30}{}", id, name, url); + println!("{id:40}{name:30}{url}"); } } } diff --git a/azure_devops_rust_api/examples/build_get.rs b/azure_devops_rust_api/examples/build_get.rs index 7ba67502..1305e068 100644 --- a/azure_devops_rust_api/examples/build_get.rs +++ b/azure_devops_rust_api/examples/build_get.rs @@ -33,7 +33,7 @@ async fn main() -> Result<()> { .get(organization, project, build_id) .await?; - println!("Build:\n{:#?}", build); + println!("Build:\n{build:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/build_list.rs b/azure_devops_rust_api/examples/build_list.rs index a1c9a091..1140bf60 100644 --- a/azure_devops_rust_api/examples/build_list.rs +++ b/azure_devops_rust_api/examples/build_list.rs @@ -39,7 +39,7 @@ async fn main() -> Result<()> { println!("Found {} builds", builds.len()); if let Some(build) = builds.first() { - println!("Example build struct: {:#?}", build); + println!("Example build struct: {build:#?}"); } Ok(()) diff --git a/azure_devops_rust_api/examples/build_list_continuation_token.rs b/azure_devops_rust_api/examples/build_list_continuation_token.rs index 35592890..3ce7d246 100644 --- a/azure_devops_rust_api/examples/build_list_continuation_token.rs +++ b/azure_devops_rust_api/examples/build_list_continuation_token.rs @@ -4,7 +4,8 @@ // build_list_continuation_token.rs // Example demonstrating how to make large queries using continuation tokens. use anyhow::{anyhow, Context, Result}; -use azure_core::StatusCode; +use azure_core::http::headers::HeaderName; +use azure_core::http::StatusCode; use azure_devops_rust_api::build; use azure_devops_rust_api::build::models::{Build, BuildList}; use std::env; @@ -23,10 +24,7 @@ async fn get_builds( let mut list_builder = build_client.builds_client().list(organization, project); if let Some(continuation_token) = continuation_token { - println!( - "Query builds with continuation_token: {}", - continuation_token - ); + println!("Query builds with continuation_token: {continuation_token}"); list_builder = list_builder.continuation_token(continuation_token) } else { println!("Query builds with no continuation_token"); @@ -39,9 +37,8 @@ async fn get_builds( return Err(anyhow!("Request failed")); } - let new_continuation_token = headers.get_optional_string( - &azure_core::headers::HeaderName::from_static("x-ms-continuationtoken"), - ); + let new_continuation_token = + headers.get_optional_string(&HeaderName::from_static("x-ms-continuationtoken")); let body_data = body.collect_string().await?; let build_list: BuildList = serde_json::from_str(&body_data) @@ -67,7 +64,7 @@ async fn main() -> Result<()> { let mut continuation_token = None; // Query several batches of builds. Each batch has 1000 builds (by default) - println!("Num build batches: {}", NUM_BUILD_BATCHES); + println!("Num build batches: {NUM_BUILD_BATCHES}"); for batch in 0..NUM_BUILD_BATCHES { let (builds, new_continuation_token) = get_builds(&build_client, &organization, &project, &continuation_token).await?; diff --git a/azure_devops_rust_api/examples/build_list_sync.rs b/azure_devops_rust_api/examples/build_list_sync.rs index 22c34afd..e565056b 100644 --- a/azure_devops_rust_api/examples/build_list_sync.rs +++ b/azure_devops_rust_api/examples/build_list_sync.rs @@ -47,7 +47,7 @@ fn main() -> Result<()> { println!("Found {} builds", builds.len()); if let Some(build) = builds.first() { - println!("Example build struct: {:#?}", build); + println!("Example build struct: {build:#?}"); } Ok(()) diff --git a/azure_devops_rust_api/examples/build_source_providers_list.rs b/azure_devops_rust_api/examples/build_source_providers_list.rs index 16b600c4..cd76263a 100644 --- a/azure_devops_rust_api/examples/build_source_providers_list.rs +++ b/azure_devops_rust_api/examples/build_source_providers_list.rs @@ -31,7 +31,7 @@ async fn main() -> Result<()> { .value; println!("Found {} source_providers", source_providers.len()); - println!("\nSource Providers:\n {:#?}", source_providers); + println!("\nSource Providers:\n {source_providers:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/core_org_projects.rs b/azure_devops_rust_api/examples/core_org_projects.rs index 56b3c477..275b9291 100644 --- a/azure_devops_rust_api/examples/core_org_projects.rs +++ b/azure_devops_rust_api/examples/core_org_projects.rs @@ -29,7 +29,7 @@ async fn main() -> Result<()> { .top(top_projects) .await?; - println!("{:#?}", org_projects); + println!("{org_projects:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/core_project_teams.rs b/azure_devops_rust_api/examples/core_project_teams.rs index 71631b4e..0c3a5681 100644 --- a/azure_devops_rust_api/examples/core_project_teams.rs +++ b/azure_devops_rust_api/examples/core_project_teams.rs @@ -35,7 +35,7 @@ async fn main() -> Result<()> { println!("\nProject teams:"); for team in project_teams.iter() { if let Some(name) = &team.web_api_team_ref.name { - println!("{}", name); + println!("{name}"); } } diff --git a/azure_devops_rust_api/examples/distributed_task.rs b/azure_devops_rust_api/examples/distributed_task.rs index 64bd83fc..206e8272 100644 --- a/azure_devops_rust_api/examples/distributed_task.rs +++ b/azure_devops_rust_api/examples/distributed_task.rs @@ -27,7 +27,7 @@ async fn main() -> Result<()> { .get_agent_pools(&organization) .await? .value; - println!("{:#?}", distributed_task_agents_pools); + println!("{distributed_task_agents_pools:#?}"); // Get a list of agent queues for the project println!("Agents queues for the project are:"); @@ -36,7 +36,7 @@ async fn main() -> Result<()> { .get_agent_queues(&organization, &project) .await? .value; - println!("{:#?}", distributed_task_agent_queues); + println!("{distributed_task_agent_queues:#?}"); // Get all variable groups for the project println!("Variable groups for the project are:"); @@ -45,7 +45,7 @@ async fn main() -> Result<()> { .get_variable_groups(&organization, &project) .await? .value; - println!("{:#?}", distributed_task_variable_groups); + println!("{distributed_task_variable_groups:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/extension_management_list.rs b/azure_devops_rust_api/examples/extension_management_list.rs index fe46d169..f8179216 100644 --- a/azure_devops_rust_api/examples/extension_management_list.rs +++ b/azure_devops_rust_api/examples/extension_management_list.rs @@ -37,12 +37,12 @@ async fn main() -> Result<()> { .. } = extension { - println!("{:65}{:24}{:40}", name, version, publisher); + println!("{name:65}{version:24}{publisher:40}"); } } if let Some(extension) = installed_extensions.first() { - println!("\nExample extension:\n{:#?}", extension); + println!("\nExample extension:\n{extension:#?}"); } Ok(()) diff --git a/azure_devops_rust_api/examples/git_commit_changes.rs b/azure_devops_rust_api/examples/git_commit_changes.rs index 321771a7..bcf746b2 100644 --- a/azure_devops_rust_api/examples/git_commit_changes.rs +++ b/azure_devops_rust_api/examples/git_commit_changes.rs @@ -31,7 +31,7 @@ async fn main() -> Result<()> { .commits_client() .get_changes(&organization, &commit_id, &repository_name, &project) .await?; - println!("Commit changes:\n{:#?}", commit_changes); + println!("Commit changes:\n{commit_changes:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/git_diff_files_between_base_and_target_branch.rs b/azure_devops_rust_api/examples/git_diff_files_between_base_and_target_branch.rs index 7e47fa3d..ce779fe6 100644 --- a/azure_devops_rust_api/examples/git_diff_files_between_base_and_target_branch.rs +++ b/azure_devops_rust_api/examples/git_diff_files_between_base_and_target_branch.rs @@ -53,17 +53,19 @@ async fn main() -> Result<()> { // Get files name which are present in the target branch for diff in diffs.iter() { - let git_object_type = diff.change.item["gitObjectType"].as_str().unwrap(); - if git_object_type == "blob" { - let file_name = diff.change.item["path"].as_str().unwrap(); - files_diff_between_branches.insert(file_name.to_string()); + if let Some(item) = &diff.change.item { + let git_object_type = item["gitObjectType"].as_str().unwrap(); + if git_object_type == "blob" { + let file_name = item["path"].as_str().unwrap(); + files_diff_between_branches.insert(file_name.to_string()); + } } } // Unique files changed in the PR println!("These files are modified in pr(target) branch:"); for file_name in files_diff_between_branches.iter() { - println!("{}", file_name) + println!("{file_name}") } Ok(()) diff --git a/azure_devops_rust_api/examples/git_items_get.rs b/azure_devops_rust_api/examples/git_items_get.rs index 2f60a018..1b3093af 100644 --- a/azure_devops_rust_api/examples/git_items_get.rs +++ b/azure_devops_rust_api/examples/git_items_get.rs @@ -38,7 +38,7 @@ async fn main() -> Result<()> { .format("json") .await?; - println!("\n{file_path} metadata:\n{:#?}", item); + println!("\n{file_path} metadata:\n{item:#?}"); // If no format is specified, the file contents are returned let rsp = git_client @@ -49,7 +49,7 @@ async fn main() -> Result<()> { .into_raw_response(); let file_data = rsp.into_body().collect_string().await?; - println!("\n{file_path} contents:\n{}", file_data); + println!("\n{file_path} contents:\n{file_data}"); // Download the entire repo as a zip archive. diff --git a/azure_devops_rust_api/examples/git_items_get_items_batch.rs b/azure_devops_rust_api/examples/git_items_get_items_batch.rs index 1d104c49..4a01bdad 100644 --- a/azure_devops_rust_api/examples/git_items_get_items_batch.rs +++ b/azure_devops_rust_api/examples/git_items_get_items_batch.rs @@ -51,7 +51,7 @@ async fn main() -> Result<()> { ) .await?; - println!("\n{file_path} metadata items batch:\n{:#?}", items_batch); + println!("\n{file_path} metadata items batch:\n{items_batch:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/git_policy_config_list.rs b/azure_devops_rust_api/examples/git_policy_config_list.rs index a024e37b..ff65207a 100644 --- a/azure_devops_rust_api/examples/git_policy_config_list.rs +++ b/azure_devops_rust_api/examples/git_policy_config_list.rs @@ -40,7 +40,7 @@ async fn main() -> Result<()> { .await? .value; - println!("Policies:\n{:#?}", policies); + println!("Policies:\n{policies:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/git_pr_commits.rs b/azure_devops_rust_api/examples/git_pr_commits.rs index 204b2ae3..d5197f5a 100644 --- a/azure_devops_rust_api/examples/git_pr_commits.rs +++ b/azure_devops_rust_api/examples/git_pr_commits.rs @@ -37,7 +37,7 @@ async fn main() -> Result<()> { .get_pull_request_commits(&organization, &repository_name, pull_request_id, &project) .top(top_commits) .await?; - println!("{:#?}", pr_commits); + println!("{pr_commits:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/git_pr_create.rs b/azure_devops_rust_api/examples/git_pr_create.rs index d2495ded..74060a31 100644 --- a/azure_devops_rust_api/examples/git_pr_create.rs +++ b/azure_devops_rust_api/examples/git_pr_create.rs @@ -32,7 +32,7 @@ async fn main() -> Result<()> { let git_client = git::ClientBuilder::new(credential).build(); // Create GitPullRequestCreateOptions with all the mandatory parameters - println!("Create PR to merge {} => {}", src_branch, target_branch); + println!("Create PR to merge {src_branch} => {target_branch}"); let mut pr_create_options = GitPullRequestCreateOptions::new( // Need to specify full git refs path format!("refs/heads/{src_branch}"), @@ -53,7 +53,7 @@ async fn main() -> Result<()> { .pull_requests_client() .create(organization, repo_name, project, pr_create_options) .await?; - println!("Created PR:\n{:#?}", pr); + println!("Created PR:\n{pr:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/git_pr_files_changed.rs b/azure_devops_rust_api/examples/git_pr_files_changed.rs index fef6c044..24f7d98f 100644 --- a/azure_devops_rust_api/examples/git_pr_files_changed.rs +++ b/azure_devops_rust_api/examples/git_pr_files_changed.rs @@ -52,7 +52,7 @@ async fn main() -> Result<()> { Some(comment) => comment.clone(), _ => "".to_string(), }; - println!("{} {}", commit_id, comment); + println!("{commit_id} {comment}"); // Get the commit changes in a commit let pr_commits_changes = git_client @@ -63,20 +63,21 @@ async fn main() -> Result<()> { // Get files changed in the commit for change in pr_commits_changes.iter() { - let item = &change.change.item; - // We are only interested in files not directories. - // files are "blob" type, directories are "folder" type. - if let (Some("blob"), Some(filename)) = - (item["git_object_type"].as_str(), item["path"].as_str()) - { - files_changed.insert(filename.to_string()); + if let Some(item) = &change.change.item { + // We are only interested in files not directories. + // files are "blob" type, directories are "folder" type. + if let (Some("blob"), Some(filename)) = + (item["git_object_type"].as_str(), item["path"].as_str()) + { + files_changed.insert(filename.to_string()); + } } } } println!("\nChanged files:"); // Unique files changed in the PR for filename in files_changed.iter() { - println!("{}", filename) + println!("{filename}") } Ok(()) diff --git a/azure_devops_rust_api/examples/git_pr_work_items.rs b/azure_devops_rust_api/examples/git_pr_work_items.rs index 6f0acaec..dc920d46 100644 --- a/azure_devops_rust_api/examples/git_pr_work_items.rs +++ b/azure_devops_rust_api/examples/git_pr_work_items.rs @@ -36,7 +36,7 @@ async fn main() -> Result<()> { .await?; println!("PR work items:"); - println!("{:#?}", pr_work_items); + println!("{pr_work_items:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/git_push.rs b/azure_devops_rust_api/examples/git_push.rs index 2026507d..e4612946 100644 --- a/azure_devops_rust_api/examples/git_push.rs +++ b/azure_devops_rust_api/examples/git_push.rs @@ -51,9 +51,9 @@ fn new_git_change_with_content( GitChange { change: Change { change_type, - item: json!({ + item: Some(json!({ "path": filename - }), + })), new_content: Some(ItemContent { content: file_content, content_type: ContentType::RawText, @@ -70,7 +70,7 @@ fn new_git_change_with_content( // Create a new `GitRefUpdate` with the specified base commit id and target branch fn new_git_ref_update(base_commit_id: String, target_branch: &str) -> GitRefUpdate { GitRefUpdate { - name: Some(format!("refs/heads/{}", target_branch)), + name: Some(format!("refs/heads/{target_branch}")), old_object_id: Some(base_commit_id), ..Default::default() } @@ -112,7 +112,7 @@ async fn main() -> Result<()> { &source_branch, ) .await?; - println!("base_commit_id: {}", base_commit_id); + println!("base_commit_id: {base_commit_id}"); // Define the base commit id and the target branch let ref_update = new_git_ref_update(base_commit_id, &target_branch); @@ -142,7 +142,7 @@ async fn main() -> Result<()> { .pushes_client() .create(&organization, push_request, &repository_name, &project) .await?; - println!("Pushed commit.\npush_response: {:#?}", push_response); + println!("Pushed commit.\npush_response: {push_response:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/git_repo_get.rs b/azure_devops_rust_api/examples/git_repo_get.rs index 5af6e2bc..701a6457 100644 --- a/azure_devops_rust_api/examples/git_repo_get.rs +++ b/azure_devops_rust_api/examples/git_repo_get.rs @@ -29,7 +29,7 @@ async fn main() -> Result<()> { .repositories_client() .get_repository(&organization, &repo_name, &project) .await?; - println!("{:#?}", repo); + println!("{repo:#?}"); // Get up to 10 pull requests on the specified repo let prs = git_client @@ -46,7 +46,7 @@ async fn main() -> Result<()> { if let Some(pr) = prs.first() { println!("\nExample PR struct:"); - println!("{:#?}", pr); + println!("{pr:#?}"); } // Get up to 10 refs on the specified repo @@ -64,7 +64,7 @@ async fn main() -> Result<()> { if let Some(git_ref) = git_refs.first() { println!("\nExample ref struct:"); - println!("{:#?}", git_ref); + println!("{git_ref:#?}"); } Ok(()) diff --git a/azure_devops_rust_api/examples/graph_query.rs b/azure_devops_rust_api/examples/graph_query.rs index 701e528c..32af6744 100644 --- a/azure_devops_rust_api/examples/graph_query.rs +++ b/azure_devops_rust_api/examples/graph_query.rs @@ -38,7 +38,7 @@ async fn main() -> Result<()> { println!("Found {} subjects", subjects.len()); if let Some(subject) = subjects.first() { - println!("subject: {:#?}", subject); + println!("subject: {subject:#?}"); } Ok(()) diff --git a/azure_devops_rust_api/examples/hooks_list.rs b/azure_devops_rust_api/examples/hooks_list.rs index 1517afc9..eee19923 100644 --- a/azure_devops_rust_api/examples/hooks_list.rs +++ b/azure_devops_rust_api/examples/hooks_list.rs @@ -25,7 +25,7 @@ async fn main() -> Result<()> { .list(&organization) .await? .value; - println!("{:#?}", service_hook_consumers); + println!("{service_hook_consumers:#?}"); // Get all publishers println!("The service hook publishers are:"); @@ -34,7 +34,7 @@ async fn main() -> Result<()> { .list(&organization) .await? .value; - println!("{:#?}", service_hook_publishers); + println!("{service_hook_publishers:#?}"); // Get all subscriptions println!("The service hook subscriptions are:"); @@ -43,7 +43,7 @@ async fn main() -> Result<()> { .list(&organization) .await? .value; - println!("{:#?}", service_hook_subscriptions); + println!("{service_hook_subscriptions:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/ims_query.rs b/azure_devops_rust_api/examples/ims_query.rs index 0c7aac3e..8dadb08b 100644 --- a/azure_devops_rust_api/examples/ims_query.rs +++ b/azure_devops_rust_api/examples/ims_query.rs @@ -40,7 +40,7 @@ async fn main() -> Result<()> { } if let Some(identity) = identities.first() { - println!("{:#?}", identity); + println!("{identity:#?}"); } Ok(()) diff --git a/azure_devops_rust_api/examples/member_entitlement_management.rs b/azure_devops_rust_api/examples/member_entitlement_management.rs index 7e3e52f4..d49f72ba 100644 --- a/azure_devops_rust_api/examples/member_entitlement_management.rs +++ b/azure_devops_rust_api/examples/member_entitlement_management.rs @@ -26,7 +26,7 @@ async fn main() -> Result<()> { .get(organization) .select("AccessLevels,Licenses,Projects,Groups") .await?; - println!("{:#?}", entitlement_summary); + println!("{entitlement_summary:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/permissions_report.rs b/azure_devops_rust_api/examples/permissions_report.rs index 0c1292d9..b8c35b58 100644 --- a/azure_devops_rust_api/examples/permissions_report.rs +++ b/azure_devops_rust_api/examples/permissions_report.rs @@ -26,7 +26,7 @@ async fn main() -> Result<()> { .list(&organization) .await? .value; - println!("{:#?}", permissions_reports); + println!("{permissions_reports:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/pipeline_preview.rs b/azure_devops_rust_api/examples/pipeline_preview.rs index c9efc012..189b4db1 100644 --- a/azure_devops_rust_api/examples/pipeline_preview.rs +++ b/azure_devops_rust_api/examples/pipeline_preview.rs @@ -61,7 +61,7 @@ async fn main() -> Result<()> { // Display the full pipeline YAML if let Some(final_yaml) = preview.final_yaml { - println!("Pipeline preview:\n{}", final_yaml); + println!("Pipeline preview:\n{final_yaml}"); } } diff --git a/azure_devops_rust_api/examples/pipelines.rs b/azure_devops_rust_api/examples/pipelines.rs index 31ee26f5..d3df2aa2 100644 --- a/azure_devops_rust_api/examples/pipelines.rs +++ b/azure_devops_rust_api/examples/pipelines.rs @@ -45,7 +45,7 @@ async fn main() -> Result<()> { if let Some(pipeline) = matched_pipelines.first() { println!("\nExample pipeline struct from list:"); - println!("{:#?}", pipeline); + println!("{pipeline:#?}"); // The pipeline struct returned from list is different from that returned by get. // Query and display the struct returned by get for comparison. @@ -54,7 +54,7 @@ async fn main() -> Result<()> { .get(&organization, &project, pipeline.id) .await?; println!("\nExample pipeline struct from get:"); - println!("{:#?}", pipeline); + println!("{pipeline:#?}"); // Use the client to list all runs of the selected pipeline let runs = pipelines_client @@ -67,7 +67,7 @@ async fn main() -> Result<()> { // Display [result, state] for each pipeline run for run in runs.iter() { let result = match &run.result { - Some(result) => format!("{:?}", result), + Some(result) => format!("{result:?}"), None => "-".to_string(), }; println!( diff --git a/azure_devops_rust_api/examples/policy.rs b/azure_devops_rust_api/examples/policy.rs index 74af0929..8e19a5ca 100644 --- a/azure_devops_rust_api/examples/policy.rs +++ b/azure_devops_rust_api/examples/policy.rs @@ -47,10 +47,7 @@ async fn main() -> Result<()> { } }) .unwrap(); - println!( - "Work item linking policy id: {}", - work_item_linking_policy_id - ); + println!("Work item linking policy id: {work_item_linking_policy_id}"); let configs = policy_client .configurations_client() @@ -61,7 +58,7 @@ async fn main() -> Result<()> { println!("{} work item policy configurations found", configs.len()); if let Some(config) = configs.first() { - println!("Example config:\n{:#?}", config); + println!("Example config:\n{config:#?}"); } Ok(()) diff --git a/azure_devops_rust_api/examples/release.rs b/azure_devops_rust_api/examples/release.rs index 9dcc9fb7..2c800dfe 100644 --- a/azure_devops_rust_api/examples/release.rs +++ b/azure_devops_rust_api/examples/release.rs @@ -28,7 +28,7 @@ async fn main() -> Result<()> { .list(&organization, &project) .await? .value; - println!("{:#?}", approvals); + println!("{approvals:#?}"); // Get list of folders println!("\nFolders:"); @@ -37,7 +37,7 @@ async fn main() -> Result<()> { .list(&organization, &project, &folder_path) .await? .value; - println!("{:#?}", folders); + println!("{folders:#?}"); // Get list of deployments println!("\nDeployments:"); @@ -46,7 +46,7 @@ async fn main() -> Result<()> { .list(&organization, &project) .await? .value; - println!("{:#?}", deployments); + println!("{deployments:#?}"); // Get a list of releases println!("\nReleases:"); @@ -55,7 +55,7 @@ async fn main() -> Result<()> { .list(&organization, &project) .await? .value; - println!("{:#?}", releases); + println!("{releases:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/release_get_release.rs b/azure_devops_rust_api/examples/release_get_release.rs index 37f96e2e..2a8b5079 100644 --- a/azure_devops_rust_api/examples/release_get_release.rs +++ b/azure_devops_rust_api/examples/release_get_release.rs @@ -33,7 +33,7 @@ async fn main() -> Result<()> { .releases_client() .get_release(&organization, &project, release_id) .await?; - println!("{:#?}", release); + println!("{release:#?}"); // Get manual interventions on a release println!("\nManual interventions:"); @@ -42,7 +42,7 @@ async fn main() -> Result<()> { .list(&organization, &project, release_id) .await? .value; - println!("{:#?}", manual_interventions); + println!("{manual_interventions:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/release_logs.rs b/azure_devops_rust_api/examples/release_logs.rs index 525f0534..37b74233 100644 --- a/azure_devops_rust_api/examples/release_logs.rs +++ b/azure_devops_rust_api/examples/release_logs.rs @@ -4,6 +4,7 @@ // Release logs example. // The log data is saved as a zip file - use `unzip` to extract use anyhow::{anyhow, Result}; +use azure_core::http::StatusCode; use azure_devops_rust_api::release; use std::env; use std::fs::File; @@ -32,7 +33,7 @@ async fn main() -> Result<()> { let release_client = release::ClientBuilder::new(credential).build(); // Get release logs - println!("\nDownloading release logs for release {}", release_id); + println!("\nDownloading release logs for release {release_id}"); let (status, _headers, body) = release_client .releases_client() .get_logs(organization, project, release_id) @@ -41,19 +42,19 @@ async fn main() -> Result<()> { .into_raw_response() .deconstruct(); - if status != azure_core::StatusCode::Ok { - println!("Request failed. status:{}", status); + if status != StatusCode::Ok { + println!("Request failed. status:{status}"); return Err(anyhow!("Request failed")); } // Write the data as a zipfile - println!("Writing data to zipfile: {}", output_file); + println!("Writing data to zipfile: {output_file}"); let data = body.collect().await?; let mut file = File::create(&output_file)?; file.write_all(&data)?; println!("Logs saved"); - println!("Use 'unzip {}' to extract the logs", output_file); + println!("Use 'unzip {output_file}' to extract the logs"); Ok(()) } diff --git a/azure_devops_rust_api/examples/search_code.rs b/azure_devops_rust_api/examples/search_code.rs index ee314af4..5692003d 100644 --- a/azure_devops_rust_api/examples/search_code.rs +++ b/azure_devops_rust_api/examples/search_code.rs @@ -84,7 +84,7 @@ async fn main() -> Result<()> { println!("Found {} results", search_results.len()); if let Some(result) = search_results.first() { - println!("Example search result:\n{:#?}", result); + println!("Example search result:\n{result:#?}"); } Ok(()) diff --git a/azure_devops_rust_api/examples/search_package.rs b/azure_devops_rust_api/examples/search_package.rs index 28577382..c6b387da 100644 --- a/azure_devops_rust_api/examples/search_package.rs +++ b/azure_devops_rust_api/examples/search_package.rs @@ -51,7 +51,7 @@ async fn main() -> Result<()> { println!("Found {} results", search_results.len()); if let Some(result) = search_results.first() { - println!("Example search result:\n{:#?}", result); + println!("Example search result:\n{result:#?}"); } Ok(()) diff --git a/azure_devops_rust_api/examples/search_repositories.rs b/azure_devops_rust_api/examples/search_repositories.rs index f8c96ecd..677776ed 100644 --- a/azure_devops_rust_api/examples/search_repositories.rs +++ b/azure_devops_rust_api/examples/search_repositories.rs @@ -33,6 +33,6 @@ async fn main() -> Result<()> { .get(organization, project, repository_name) .await?; - println!("{:#?}", search_results); + println!("{search_results:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/search_work_item.rs b/azure_devops_rust_api/examples/search_work_item.rs index 3e7b3083..777b2d78 100644 --- a/azure_devops_rust_api/examples/search_work_item.rs +++ b/azure_devops_rust_api/examples/search_work_item.rs @@ -54,7 +54,7 @@ async fn main() -> Result<()> { println!("Found {} results", search_results.len()); if let Some(result) = search_results.first() { - println!("Example search work item result:\n{:#?}", result); + println!("Example search work item result:\n{result:#?}"); } Ok(()) diff --git a/azure_devops_rust_api/examples/service_endpoint.rs b/azure_devops_rust_api/examples/service_endpoint.rs index 293d8c6b..190eec62 100644 --- a/azure_devops_rust_api/examples/service_endpoint.rs +++ b/azure_devops_rust_api/examples/service_endpoint.rs @@ -32,15 +32,17 @@ async fn main() -> Result<()> { // Display the returned service endpoints for endpoint in service_endpoints.iter() { println!( - "{:38} {:40} {}", - endpoint.id, endpoint.name, endpoint.description + "{:38} {:40} {:?}", + endpoint.id, + endpoint.name, + endpoint.description.as_deref().unwrap_or("") ); } // Display an example service endpoint struct if let Some(endpoint) = service_endpoints.first() { println!("\nExample service_endpoint struct:"); - println!("{:#?}", endpoint); + println!("{endpoint:#?}"); } Ok(()) diff --git a/azure_devops_rust_api/examples/test_plan.rs b/azure_devops_rust_api/examples/test_plan.rs index 5837b389..1ae76d82 100644 --- a/azure_devops_rust_api/examples/test_plan.rs +++ b/azure_devops_rust_api/examples/test_plan.rs @@ -31,7 +31,7 @@ async fn main() -> Result<()> { .list(&organization, &project) .await? .value; - println!("{:#?}", test_plans); + println!("{test_plans:#?}"); // Get all suites for a test plan for a project println!("The suites for the a plan for project are:"); @@ -40,7 +40,7 @@ async fn main() -> Result<()> { .get_test_suites_for_plan(&organization, &project, test_plan_id) .await? .value; - println!("{:#?}", test_suites); + println!("{test_suites:#?}"); // Get all test plan variables for project println!("The test plans variables for project are:"); @@ -49,7 +49,7 @@ async fn main() -> Result<()> { .list(&organization, &project) .await? .value; - println!("{:#?}", test_plan_variables); + println!("{test_plan_variables:#?}"); // Get all test plan configuration for project println!("The test plan configuration for project are:"); @@ -58,7 +58,7 @@ async fn main() -> Result<()> { .list(&organization, &project) .await? .value; - println!("{:#?}", test_plan_configuration); + println!("{test_plan_configuration:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/test_runs_list.rs b/azure_devops_rust_api/examples/test_runs_list.rs index 1b8a1db6..0bd8d56d 100644 --- a/azure_devops_rust_api/examples/test_runs_list.rs +++ b/azure_devops_rust_api/examples/test_runs_list.rs @@ -32,7 +32,7 @@ async fn main() -> Result<()> { .top(top_test_runs) .await? .value; - println!("{:#?}", test_runs); + println!("{test_runs:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/utils/mod.rs b/azure_devops_rust_api/examples/utils/mod.rs index 2b97dfec..f46a3e6b 100644 --- a/azure_devops_rust_api/examples/utils/mod.rs +++ b/azure_devops_rust_api/examples/utils/mod.rs @@ -3,29 +3,19 @@ use anyhow::Result; use async_trait::async_trait; -use azure_core::{Context, Policy, PolicyResult, Request}; +use azure_core::http::{ + policies::{Policy, PolicyResult}, + Context, Request, +}; use azure_devops_rust_api::Credential; -use azure_identity::DefaultAzureCredentialBuilder; +use azure_identity::AzureCliCredential; use std::sync::Arc; -fn authenticate_with_default_credential() -> Result { - println!("Authenticate using auto-refreshing DefaultAzureCredential"); - // `DefaultAzureCredential` can authenticate using one of: - // - `EnvironmentCredential` - // - `ManagedIdentityCredential` - // - `AzureCliCredential` - // For examples we just want to use AzureCliCredential, so exclude the - // other mechanisms. - // It would be simpler to directly create `AzureCliCredential` here, but I want to - // demonstrate use of `DefaultAzureCredentialBuilder`. - let default_azure_credential = Arc::new( - DefaultAzureCredentialBuilder::new() - .exclude_environment_credential() - .exclude_managed_identity_credential() - .build()?, - ); +fn authenticate_with_cli_credential() -> Result { + println!("Authenticate using Azure CLI credential"); + let azure_cli_credential = AzureCliCredential::new(None)?; - Ok(Credential::from_token_credential(default_azure_credential)) + Ok(Credential::from_token_credential(azure_cli_credential)) } #[allow(dead_code)] @@ -36,7 +26,7 @@ pub fn get_credential() -> Result { println!("Authenticate using PAT provided via $ADO_TOKEN"); Ok(Credential::from_pat(token)) } - _ => authenticate_with_default_credential(), + _ => authenticate_with_cli_credential(), } } @@ -53,7 +43,7 @@ impl AcceptZipPolicy { /// Always set the `accept` header to `application/zip` #[async_trait] -impl azure_core::Policy for AcceptZipPolicy { +impl Policy for AcceptZipPolicy { async fn send( &self, ctx: &Context, diff --git a/azure_devops_rust_api/examples/wiki_pages_create_or_update.rs b/azure_devops_rust_api/examples/wiki_pages_create_or_update.rs index b43eb53d..92375caf 100644 --- a/azure_devops_rust_api/examples/wiki_pages_create_or_update.rs +++ b/azure_devops_rust_api/examples/wiki_pages_create_or_update.rs @@ -64,7 +64,7 @@ async fn main() -> Result<()> { .await { Ok(p) => println!("Page updated: {:?}", p.remote_url), - Err(e) => panic!("Failed to update wiki page: {}", e), + Err(e) => panic!("Failed to update wiki page: {e}"), } } None => { @@ -81,7 +81,7 @@ async fn main() -> Result<()> { .await { Ok(p) => println!("Page created: {:?}", p.remote_url), - Err(e) => panic!("Failed to create wiki page: {}", e), + Err(e) => panic!("Failed to create wiki page: {e}"), } } } @@ -108,21 +108,20 @@ async fn get_wiki_page_etag( { Ok(r) => { let etag = r.headers().e_tag().unwrap().to_owned(); - println!("Etag for page {}, {}", page_path, etag); + println!("Etag for page {page_path}, {etag}"); Some(etag) } Err(e) => { // If the response is a 404 then we need to create the page - if e.as_http_error() - .expect("Failed cast to http error") - .status() + if e.http_status() + .expect("Failed to retrieve HTTP status") .canonical_reason() == "Not Found" { println!("Wiki page does not exist"); None } else { - panic!("Failed to retrieve etag: {}", e) + panic!("Failed to retrieve etag") } } } diff --git a/azure_devops_rust_api/examples/wit_wiql.rs b/azure_devops_rust_api/examples/wit_wiql.rs index 226d4c20..355f613e 100644 --- a/azure_devops_rust_api/examples/wit_wiql.rs +++ b/azure_devops_rust_api/examples/wit_wiql.rs @@ -110,10 +110,7 @@ async fn query_workitems( }) .collect(); - println!( - "workitem_batch_get_requests: {:#?}", - workitem_batch_get_requests - ); + println!("workitem_batch_get_requests: {workitem_batch_get_requests:#?}"); // Get work item batches in parallel and collect into a vector let workitem_batches: Vec = workitem_batch_get_requests diff --git a/azure_devops_rust_api/examples/wit_work_item_create.rs b/azure_devops_rust_api/examples/wit_work_item_create.rs index 90d5757d..1d6f4401 100644 --- a/azure_devops_rust_api/examples/wit_work_item_create.rs +++ b/azure_devops_rust_api/examples/wit_work_item_create.rs @@ -44,7 +44,7 @@ async fn main() -> Result<()> { .create(organization, body, project, work_item_type) .await?; - println!("{:#?}", work_item); + println!("{work_item:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/wit_work_item_get.rs b/azure_devops_rust_api/examples/wit_work_item_get.rs index 02b2cde5..0e96e5f8 100644 --- a/azure_devops_rust_api/examples/wit_work_item_get.rs +++ b/azure_devops_rust_api/examples/wit_work_item_get.rs @@ -77,7 +77,7 @@ async fn main() -> Result<()> { .expand("All") .await?; - println!("Work item [{work_item_id}]:\n{:#?}", work_item); + println!("Work item [{work_item_id}]:\n{work_item:#?}"); // Show work item type println!("Work item type: {}", work_item_type(&work_item)); diff --git a/azure_devops_rust_api/examples/wit_work_item_queries.rs b/azure_devops_rust_api/examples/wit_work_item_queries.rs index b3e49cf8..19bac6f7 100644 --- a/azure_devops_rust_api/examples/wit_work_item_queries.rs +++ b/azure_devops_rust_api/examples/wit_work_item_queries.rs @@ -27,7 +27,7 @@ async fn main() -> Result<()> { .list(&organization, &project) .await?; - println!("All work item queries:\n{:#?}", work_item_queries); + println!("All work item queries:\n{work_item_queries:#?}"); Ok(()) } diff --git a/azure_devops_rust_api/examples/work.rs b/azure_devops_rust_api/examples/work.rs index a68472f8..f6406ff8 100644 --- a/azure_devops_rust_api/examples/work.rs +++ b/azure_devops_rust_api/examples/work.rs @@ -32,14 +32,14 @@ async fn main() -> Result<()> { .teamsettings_client() .get(&organization, &project, &team) .await?; - println!("Team settings:\n{:#?}", team_settings); + println!("Team settings:\n{team_settings:#?}"); // Get all iterations let iterations = work_client .iterations_client() .list(&organization, &project, &team) .await?; - println!("\nIterations:\n{:#?}", iterations); + println!("\nIterations:\n{iterations:#?}"); // Get current iteration let current_iteration = work_client @@ -47,7 +47,7 @@ async fn main() -> Result<()> { .list(&organization, &project, &team) .timeframe("current") .await?; - println!("\nCurrent iteration:\n{:#?}", current_iteration); + println!("\nCurrent iteration:\n{current_iteration:#?}"); // Get current iteration id let current_iteration_id = current_iteration @@ -64,10 +64,7 @@ async fn main() -> Result<()> { .iterations_client() .get_iteration_work_items(&organization, &project, current_iteration_id, &team) .await?; - println!( - "\nCurrent iteration workitems:\n{:#?}", - current_iteration_workitems - ); + println!("\nCurrent iteration workitems:\n{current_iteration_workitems:#?}"); println!( "\nCurrent iteration work_item_relations length: {}", diff --git a/azure_devops_rust_api/src/accounts/mod.rs b/azure_devops_rust_api/src/accounts/mod.rs index 86355574..8e920183 100644 --- a/azure_devops_rust_api/src/accounts/mod.rs +++ b/azure_devops_rust_api/src/accounts/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://app.vssps.visualstudio.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -158,37 +159,15 @@ pub mod accounts { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AccountList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -237,14 +216,18 @@ pub mod accounts { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(owner_id) = &this.owner_id { req.url_mut() @@ -261,21 +244,25 @@ pub mod accounts { .query_pairs_mut() .append_pair("properties", properties); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = - azure_core::Url::parse(&format!("{}/_apis/accounts", self.client.endpoint(),))?; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/_apis/accounts", + self.client.endpoint(), + ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/accounts/models.rs b/azure_devops_rust_api/src/accounts/models.rs index 0e1ea569..68cbab54 100644 --- a/azure_devops_rust_api/src/accounts/models.rs +++ b/azure_devops_rust_api/src/accounts/models.rs @@ -154,7 +154,7 @@ pub struct AccountCreateInfoInternal { #[serde( rename = "serviceDefinitions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub service_definitions: Vec, @@ -170,7 +170,7 @@ pub struct AccountList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -205,14 +205,14 @@ pub struct PropertiesCollection { #[doc = "The set of keys in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub keys: Vec, #[doc = "The set of values in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, diff --git a/azure_devops_rust_api/src/approvals_and_checks/mod.rs b/azure_devops_rust_api/src/approvals_and_checks/mod.rs index 61803441..c018948a 100644 --- a/azure_devops_rust_api/src/approvals_and_checks/mod.rs +++ b/azure_devops_rust_api/src/approvals_and_checks/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -218,40 +219,20 @@ pub mod pipeline_permissions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ResourcePipelinePermissionsList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourcePipelinePermissionsList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -286,24 +267,28 @@ pub mod pipeline_permissions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/pipelinepermissions", self.client.endpoint(), &self.organization, @@ -311,10 +296,12 @@ pub mod pipeline_permissions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -340,40 +327,20 @@ pub mod pipeline_permissions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ResourcePipelinePermissions, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourcePipelinePermissions = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -409,23 +376,27 @@ pub mod pipeline_permissions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/pipelinepermissions/{}/{}", self.client.endpoint(), &self.organization, @@ -435,10 +406,12 @@ pub mod pipeline_permissions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -464,40 +437,20 @@ pub mod pipeline_permissions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ResourcePipelinePermissions, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourcePipelinePermissions = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -534,24 +487,28 @@ pub mod pipeline_permissions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/pipelinepermissions/{}/{}", self.client.endpoint(), &self.organization, @@ -561,10 +518,12 @@ pub mod pipeline_permissions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -717,38 +676,18 @@ pub mod check_configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::CheckConfigurationList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckConfigurationList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -799,14 +738,18 @@ pub mod check_configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(resource_type) = &this.resource_type { req.url_mut() @@ -823,14 +766,14 @@ pub mod check_configurations { .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/checks/configurations", self.client.endpoint(), &self.organization, @@ -838,10 +781,12 @@ pub mod check_configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -867,38 +812,15 @@ pub mod check_configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -933,24 +855,28 @@ pub mod check_configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/checks/configurations", self.client.endpoint(), &self.organization, @@ -958,10 +884,12 @@ pub mod check_configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -986,38 +914,15 @@ pub mod check_configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1057,28 +962,32 @@ pub mod check_configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/checks/configurations/{}", self.client.endpoint(), &self.organization, @@ -1087,10 +996,12 @@ pub mod check_configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1115,38 +1026,15 @@ pub mod check_configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1182,24 +1070,28 @@ pub mod check_configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/checks/configurations/{}", self.client.endpoint(), &self.organization, @@ -1208,10 +1100,12 @@ pub mod check_configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1236,23 +1130,10 @@ pub mod check_configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1287,23 +1168,27 @@ pub mod check_configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/checks/configurations/{}", self.client.endpoint(), &self.organization, @@ -1312,10 +1197,12 @@ pub mod check_configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1343,38 +1230,18 @@ pub mod check_configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::CheckConfigurationList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckConfigurationList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1415,29 +1282,33 @@ pub mod check_configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/checks/queryconfigurations", self.client.endpoint(), &self.organization, @@ -1445,10 +1316,12 @@ pub mod check_configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1522,37 +1395,15 @@ pub mod check_evaluations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckSuite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1592,29 +1443,33 @@ pub mod check_evaluations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/checks/runs", self.client.endpoint(), &self.organization, @@ -1622,10 +1477,12 @@ pub mod check_evaluations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1650,37 +1507,15 @@ pub mod check_evaluations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckSuite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1720,28 +1555,32 @@ pub mod check_evaluations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/checks/runs/{}", self.client.endpoint(), &self.organization, @@ -1750,10 +1589,12 @@ pub mod check_evaluations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1847,37 +1688,15 @@ pub mod approvals { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ApprovalList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1941,14 +1760,18 @@ pub mod approvals { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(approval_ids) = &this.approval_ids { req.url_mut() @@ -1973,14 +1796,14 @@ pub mod approvals { .query_pairs_mut() .append_pair("top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/approvals", self.client.endpoint(), &self.organization, @@ -1988,10 +1811,12 @@ pub mod approvals { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2016,37 +1841,15 @@ pub mod approvals { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ApprovalList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2081,24 +1884,28 @@ pub mod approvals { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/approvals", self.client.endpoint(), &self.organization, @@ -2106,10 +1913,12 @@ pub mod approvals { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2134,37 +1943,15 @@ pub mod approvals { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Approval = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2204,28 +1991,32 @@ pub mod approvals { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/approvals/{}", self.client.endpoint(), &self.organization, @@ -2234,10 +2025,12 @@ pub mod approvals { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/approvals_and_checks/models.rs b/azure_devops_rust_api/src/approvals_and_checks/models.rs index af4c6b9d..881dbb14 100644 --- a/azure_devops_rust_api/src/approvals_and_checks/models.rs +++ b/azure_devops_rust_api/src/approvals_and_checks/models.rs @@ -14,7 +14,7 @@ pub struct Approval { #[serde( rename = "blockedApprovers", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub blocked_approvers: Vec, @@ -63,7 +63,7 @@ pub struct Approval { #[doc = "List of steps associated with the approval."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub steps: Vec, @@ -155,7 +155,7 @@ pub struct ApprovalConfig { #[doc = "Ordered list of approvers."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub approvers: Vec, @@ -163,7 +163,7 @@ pub struct ApprovalConfig { #[serde( rename = "blockedApprovers", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub blocked_approvers: Vec, @@ -225,7 +225,7 @@ pub struct ApprovalList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -288,7 +288,7 @@ pub struct ApprovalStep { #[doc = "History of the approval step"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub history: Vec, @@ -471,7 +471,7 @@ pub struct ApprovalsQueryParameters { #[serde( rename = "approvalIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub approval_ids: Vec, @@ -489,7 +489,7 @@ pub struct ApprovalsQueryParameters { #[serde( rename = "userIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub user_ids: Vec, @@ -605,7 +605,7 @@ pub struct CheckConfigurationList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -639,7 +639,7 @@ pub struct CheckData { #[serde( rename = "checkConfigurationDataList", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub check_configuration_data_list: Vec, @@ -647,7 +647,7 @@ pub struct CheckData { #[serde( rename = "checkDefinitions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub check_definitions: Vec, @@ -662,7 +662,7 @@ pub struct CheckData { #[serde( rename = "timeZoneList", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub time_zone_list: Vec, @@ -707,7 +707,7 @@ pub struct CheckDefinitionData { #[serde( rename = "uiContributionDependencies", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ui_contribution_dependencies: Vec, @@ -794,7 +794,7 @@ pub struct CheckIssueData { #[serde( rename = "resourcesWithCheckIssuesList", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub resources_with_check_issues_list: Vec, @@ -889,7 +889,7 @@ pub struct CheckSuite { #[serde( rename = "checkRuns", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub check_runs: Vec, @@ -962,7 +962,7 @@ pub struct CheckSuiteRequest { pub id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub resources: Vec, @@ -1135,7 +1135,7 @@ impl PipelinePermission { pub struct PipelineProcessResources { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub resources: Vec, @@ -1235,7 +1235,7 @@ pub struct ResourcePipelinePermissions { pub all_pipelines: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub pipelines: Vec, @@ -1253,7 +1253,7 @@ pub struct ResourcePipelinePermissionsList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/artifacts/mod.rs b/azure_devops_rust_api/src/artifacts/mod.rs index 83ba2567..51ea179d 100644 --- a/azure_devops_rust_api/src/artifacts/mod.rs +++ b/azure_devops_rust_api/src/artifacts/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://feeds.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -200,38 +201,15 @@ pub mod service_settings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GlobalPermissionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -270,38 +248,44 @@ pub mod service_settings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_ids) = &this.include_ids { req.url_mut() .query_pairs_mut() .append_pair("includeIds", &include_ids.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/packaging/globalpermissions", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -326,38 +310,15 @@ pub mod service_settings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GlobalPermissionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -391,34 +352,40 @@ pub mod service_settings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/packaging/globalpermissions", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -512,38 +479,15 @@ pub mod change_tracking { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedChangesResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -595,14 +539,18 @@ pub mod change_tracking { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_deleted) = &this.include_deleted { req.url_mut() @@ -619,14 +567,14 @@ pub mod change_tracking { .query_pairs_mut() .append_pair("batchSize", &batch_size.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feedchanges", self.client.endpoint(), &self.organization, @@ -634,10 +582,12 @@ pub mod change_tracking { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -662,37 +612,15 @@ pub mod change_tracking { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedChange = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -727,23 +655,27 @@ pub mod change_tracking { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feedchanges/{}", self.client.endpoint(), &self.organization, @@ -752,10 +684,12 @@ pub mod change_tracking { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -780,38 +714,18 @@ pub mod change_tracking { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PackageChangesResponse, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageChangesResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -858,14 +772,18 @@ pub mod change_tracking { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(continuation_token) = &this.continuation_token { req.url_mut() @@ -877,14 +795,14 @@ pub mod change_tracking { .query_pairs_mut() .append_pair("batchSize", &batch_size.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/packagechanges", self.client.endpoint(), &self.organization, @@ -893,10 +811,12 @@ pub mod change_tracking { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -982,37 +902,15 @@ pub mod feed_recycle_bin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1046,23 +944,27 @@ pub mod feed_recycle_bin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feedrecyclebin", self.client.endpoint(), &self.organization, @@ -1070,10 +972,12 @@ pub mod feed_recycle_bin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1098,23 +1002,10 @@ pub mod feed_recycle_bin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1150,24 +1041,28 @@ pub mod feed_recycle_bin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feedrecyclebin/{}", self.client.endpoint(), &self.organization, @@ -1176,10 +1071,12 @@ pub mod feed_recycle_bin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1207,23 +1104,10 @@ pub mod feed_recycle_bin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1258,23 +1142,27 @@ pub mod feed_recycle_bin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feedrecyclebin/{}", self.client.endpoint(), &self.organization, @@ -1283,10 +1171,12 @@ pub mod feed_recycle_bin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1578,37 +1468,15 @@ pub mod feed_management { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1660,14 +1528,18 @@ pub mod feed_management { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(feed_role) = &this.feed_role { req.url_mut() @@ -1685,14 +1557,14 @@ pub mod feed_management { .query_pairs_mut() .append_pair("includeUrls", &include_urls.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds", self.client.endpoint(), &self.organization, @@ -1700,10 +1572,12 @@ pub mod feed_management { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1728,37 +1602,13 @@ pub mod feed_management { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Feed = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1793,24 +1643,28 @@ pub mod feed_management { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds", self.client.endpoint(), &self.organization, @@ -1818,10 +1672,12 @@ pub mod feed_management { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1846,37 +1702,13 @@ pub mod feed_management { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Feed = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1917,14 +1749,18 @@ pub mod feed_management { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_deleted_upstreams) = &this.include_deleted_upstreams { req.url_mut().query_pairs_mut().append_pair( @@ -1932,14 +1768,14 @@ pub mod feed_management { &include_deleted_upstreams.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}", self.client.endpoint(), &self.organization, @@ -1948,10 +1784,12 @@ pub mod feed_management { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1976,37 +1814,13 @@ pub mod feed_management { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Feed = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2042,24 +1856,28 @@ pub mod feed_management { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}", self.client.endpoint(), &self.organization, @@ -2068,10 +1886,12 @@ pub mod feed_management { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2096,23 +1916,10 @@ pub mod feed_management { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2147,23 +1954,27 @@ pub mod feed_management { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}", self.client.endpoint(), &self.organization, @@ -2172,10 +1983,12 @@ pub mod feed_management { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2203,38 +2016,15 @@ pub mod feed_management { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedPermissionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2296,14 +2086,18 @@ pub mod feed_management { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_ids) = &this.include_ids { req.url_mut() @@ -2329,14 +2123,14 @@ pub mod feed_management { &include_deleted_feeds.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/permissions", self.client.endpoint(), &self.organization, @@ -2345,10 +2139,12 @@ pub mod feed_management { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2373,38 +2169,15 @@ pub mod feed_management { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedPermissionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2440,24 +2213,28 @@ pub mod feed_management { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/permissions", self.client.endpoint(), &self.organization, @@ -2466,10 +2243,12 @@ pub mod feed_management { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2494,37 +2273,15 @@ pub mod feed_management { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedViewList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2559,23 +2316,27 @@ pub mod feed_management { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/views", self.client.endpoint(), &self.organization, @@ -2584,10 +2345,12 @@ pub mod feed_management { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2612,37 +2375,15 @@ pub mod feed_management { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedView = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2678,24 +2419,28 @@ pub mod feed_management { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/views", self.client.endpoint(), &self.organization, @@ -2704,10 +2449,12 @@ pub mod feed_management { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2732,37 +2479,15 @@ pub mod feed_management { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedView = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2798,23 +2523,27 @@ pub mod feed_management { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", self.client.endpoint(), &self.organization, @@ -2824,10 +2553,12 @@ pub mod feed_management { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2852,37 +2583,15 @@ pub mod feed_management { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedView = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2919,24 +2628,28 @@ pub mod feed_management { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", self.client.endpoint(), &self.organization, @@ -2946,10 +2659,12 @@ pub mod feed_management { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2974,23 +2689,10 @@ pub mod feed_management { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3026,23 +2728,27 @@ pub mod feed_management { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", self.client.endpoint(), &self.organization, @@ -3052,10 +2758,12 @@ pub mod feed_management { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3292,38 +3000,15 @@ pub mod artifact_details { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageMetricsList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3359,24 +3044,28 @@ pub mod artifact_details { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/packagemetricsbatch", self.client.endpoint(), &self.organization, @@ -3385,10 +3074,12 @@ pub mod artifact_details { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3413,37 +3104,15 @@ pub mod artifact_details { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3565,14 +3234,18 @@ pub mod artifact_details { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(protocol_type) = &this.protocol_type { req.url_mut() @@ -3647,14 +3320,14 @@ pub mod artifact_details { .query_pairs_mut() .append_pair("directUpstreamId", direct_upstream_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/packages", self.client.endpoint(), &self.organization, @@ -3663,10 +3336,12 @@ pub mod artifact_details { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3691,37 +3366,15 @@ pub mod artifact_details { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3793,14 +3446,18 @@ pub mod artifact_details { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_all_versions) = &this.include_all_versions { req.url_mut().query_pairs_mut().append_pair( @@ -3834,14 +3491,14 @@ pub mod artifact_details { &include_description.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/packages/{}", self.client.endpoint(), &self.organization, @@ -3851,10 +3508,12 @@ pub mod artifact_details { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3879,38 +3538,18 @@ pub mod artifact_details { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PackageVersionMetricsList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageVersionMetricsList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3947,24 +3586,28 @@ pub mod artifact_details { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versionmetricsbatch", self.client.endpoint(), &self.organization, @@ -3974,10 +3617,12 @@ pub mod artifact_details { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4003,38 +3648,15 @@ pub mod artifact_details { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageVersionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4088,14 +3710,18 @@ pub mod artifact_details { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_urls) = &this.include_urls { req.url_mut() @@ -4112,14 +3738,14 @@ pub mod artifact_details { .query_pairs_mut() .append_pair("isDeleted", &is_deleted.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versions", self.client.endpoint(), &self.organization, @@ -4129,10 +3755,12 @@ pub mod artifact_details { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4157,37 +3785,15 @@ pub mod artifact_details { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageVersion = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4242,14 +3848,18 @@ pub mod artifact_details { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_urls) = &this.include_urls { req.url_mut() @@ -4266,14 +3876,14 @@ pub mod artifact_details { .query_pairs_mut() .append_pair("isDeleted", &is_deleted.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -4284,10 +3894,12 @@ pub mod artifact_details { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4312,38 +3924,18 @@ pub mod artifact_details { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PackageVersionProvenance, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageVersionProvenance = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4380,23 +3972,27 @@ pub mod artifact_details { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/Versions/{}/provenance", self.client.endpoint(), &self.organization, @@ -4407,10 +4003,12 @@ pub mod artifact_details { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4436,37 +4034,13 @@ pub mod artifact_details { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4502,23 +4076,27 @@ pub mod artifact_details { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/public/packaging/Feeds/{}/Packages/{}/badge", self.client.endpoint(), &self.organization, @@ -4528,10 +4106,12 @@ pub mod artifact_details { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4682,37 +4262,15 @@ pub mod recycle_bin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4783,14 +4341,18 @@ pub mod recycle_bin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(protocol_type) = &this.protocol_type { req.url_mut() @@ -4823,14 +4385,14 @@ pub mod recycle_bin { &include_all_versions.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages", self.client.endpoint(), &self.organization, @@ -4839,10 +4401,12 @@ pub mod recycle_bin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4867,38 +4431,15 @@ pub mod recycle_bin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4933,23 +4474,27 @@ pub mod recycle_bin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages", self.client.endpoint(), &self.organization, @@ -4958,10 +4503,12 @@ pub mod recycle_bin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4986,37 +4533,15 @@ pub mod recycle_bin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5058,28 +4583,32 @@ pub mod recycle_bin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_urls) = &this.include_urls { req.url_mut() .query_pairs_mut() .append_pair("includeUrls", &include_urls.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}", self.client.endpoint(), &self.organization, @@ -5089,10 +4618,12 @@ pub mod recycle_bin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5117,40 +4648,20 @@ pub mod recycle_bin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::RecycleBinPackageVersionList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RecycleBinPackageVersionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5192,28 +4703,32 @@ pub mod recycle_bin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_urls) = &this.include_urls { req.url_mut() .query_pairs_mut() .append_pair("includeUrls", &include_urls.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}/Versions", self.client.endpoint(), &self.organization, @@ -5223,10 +4738,12 @@ pub mod recycle_bin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5252,38 +4769,18 @@ pub mod recycle_bin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::RecycleBinPackageVersion, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RecycleBinPackageVersion = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5326,28 +4823,32 @@ pub mod recycle_bin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_urls) = &this.include_urls { req.url_mut() .query_pairs_mut() .append_pair("includeUrls", &include_urls.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}/Versions/{}", self.client.endpoint(), &self.organization, @@ -5358,10 +4859,12 @@ pub mod recycle_bin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5457,38 +4960,15 @@ pub mod retention_policies { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedRetentionPolicy = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5523,23 +5003,27 @@ pub mod retention_policies { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", self.client.endpoint(), &self.organization, @@ -5548,10 +5032,12 @@ pub mod retention_policies { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5576,38 +5062,15 @@ pub mod retention_policies { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedRetentionPolicy = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5643,24 +5106,28 @@ pub mod retention_policies { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", self.client.endpoint(), &self.organization, @@ -5669,10 +5136,12 @@ pub mod retention_policies { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5697,23 +5166,10 @@ pub mod retention_policies { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5748,23 +5204,27 @@ pub mod retention_policies { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", self.client.endpoint(), &self.organization, @@ -5773,10 +5233,12 @@ pub mod retention_policies { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5836,38 +5298,15 @@ pub mod provenance { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SessionResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5903,24 +5342,28 @@ pub mod provenance { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/provenance/session/{}", self.client.endpoint(), &self.organization, @@ -5929,10 +5372,12 @@ pub mod provenance { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/artifacts/models.rs b/azure_devops_rust_api/src/artifacts/models.rs index d1954c5d..870f8baf 100644 --- a/azure_devops_rust_api/src/artifacts/models.rs +++ b/azure_devops_rust_api/src/artifacts/models.rs @@ -266,7 +266,7 @@ pub struct Feed { #[doc = "Explicit permissions for the feed."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub permissions: Vec, @@ -381,7 +381,7 @@ pub struct FeedChangesResponse { #[serde( rename = "feedChanges", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub feed_changes: Vec, @@ -444,7 +444,7 @@ pub struct FeedCore { #[serde( rename = "upstreamSources", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub upstream_sources: Vec, @@ -504,7 +504,7 @@ pub struct FeedList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -579,7 +579,7 @@ pub struct FeedPermissionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -670,7 +670,7 @@ pub struct FeedUpdate { #[serde( rename = "upstreamSources", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub upstream_sources: Vec, @@ -738,7 +738,7 @@ pub struct FeedViewList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -817,7 +817,7 @@ pub struct GlobalPermissionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -969,7 +969,7 @@ pub struct MinimalPackageVersion { #[doc = "List of views containing this package version."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub views: Vec, @@ -1057,7 +1057,7 @@ pub struct Package { #[doc = "All versions for this package within its feed."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub versions: Vec, @@ -1106,7 +1106,7 @@ pub struct PackageChangesResponse { #[serde( rename = "packageChanges", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub package_changes: Vec, @@ -1148,7 +1148,7 @@ pub struct PackageFile { #[doc = "Hierarchical representation of files."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub children: Vec, @@ -1174,7 +1174,7 @@ pub struct PackageList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1224,7 +1224,7 @@ pub struct PackageMetricsList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1241,7 +1241,7 @@ pub struct PackageMetricsQuery { #[serde( rename = "packageIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub package_ids: Vec, @@ -1273,7 +1273,7 @@ pub struct PackageVersion { #[doc = "List of dependencies for this package version."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dependencies: Vec, @@ -1283,7 +1283,7 @@ pub struct PackageVersion { #[doc = "Files associated with this package version, only relevant for multi-file package types."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub files: Vec, @@ -1291,7 +1291,7 @@ pub struct PackageVersion { #[serde( rename = "otherVersions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub other_versions: Vec, @@ -1306,7 +1306,7 @@ pub struct PackageVersion { #[serde( rename = "sourceChain", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub source_chain: Vec, @@ -1316,7 +1316,7 @@ pub struct PackageVersion { #[doc = "Package version tags."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -1378,7 +1378,7 @@ pub struct PackageVersionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1435,7 +1435,7 @@ pub struct PackageVersionMetricsList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1452,7 +1452,7 @@ pub struct PackageVersionMetricsQuery { #[serde( rename = "packageVersionIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub package_version_ids: Vec, @@ -1577,7 +1577,7 @@ pub struct RecycleBinPackageVersionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1655,7 +1655,7 @@ pub struct SbomTelemetry { #[serde( rename = "sbomFormatsUsed", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub sbom_formats_used: Vec, @@ -1697,14 +1697,14 @@ pub struct SaveCachedPackagesData { #[serde( rename = "normalizedPackageNames", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub normalized_package_names: Vec, #[serde( rename = "viewsForPromotion", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub views_for_promotion: Vec, @@ -1883,7 +1883,7 @@ pub struct UpstreamSource { #[serde( rename = "statusDetails", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub status_details: Vec, diff --git a/azure_devops_rust_api/src/artifacts_package_types/mod.rs b/azure_devops_rust_api/src/artifacts_package_types/mod.rs index b90ec5ef..4c58a923 100644 --- a/azure_devops_rust_api/src/artifacts_package_types/mod.rs +++ b/azure_devops_rust_api/src/artifacts_package_types/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://pkgs.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -461,38 +462,15 @@ pub mod maven { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UpstreamingBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -529,23 +507,27 @@ pub mod maven { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/upstreaming", self.client.endpoint(), &self.organization, @@ -556,10 +538,12 @@ pub mod maven { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -584,23 +568,10 @@ pub mod maven { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -638,24 +609,28 @@ pub mod maven { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/upstreaming", self.client.endpoint(), &self.organization, @@ -666,10 +641,12 @@ pub mod maven { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -697,37 +674,15 @@ pub mod maven { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -771,28 +726,32 @@ pub mod maven { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(show_deleted) = &this.show_deleted { req.url_mut() .query_pairs_mut() .append_pair("showDeleted", &show_deleted.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -804,10 +763,12 @@ pub mod maven { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -832,23 +793,10 @@ pub mod maven { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -887,24 +835,28 @@ pub mod maven { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -916,10 +868,12 @@ pub mod maven { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -947,23 +901,10 @@ pub mod maven { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1001,23 +942,27 @@ pub mod maven { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -1029,10 +974,12 @@ pub mod maven { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1060,40 +1007,20 @@ pub mod maven { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::MavenPackageVersionDeletionState, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::MavenPackageVersionDeletionState = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1131,29 +1058,35 @@ pub mod maven { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/groups/{}/artifacts/{}/versions/{}" , self . client . endpoint () , & self . organization , & self . project , & self . feed , & self . group_id , & self . artifact_id , & self . version)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/groups/{}/artifacts/{}/versions/{}" , self . client . endpoint () , & self . organization , & self . project , & self . feed , & self . group_id , & self . artifact_id , & self . version)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1179,23 +1112,10 @@ pub mod maven { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1234,30 +1154,36 @@ pub mod maven { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/groups/{}/artifacts/{}/versions/{}" , self . client . endpoint () , & self . organization , & self . project , & self . feed , & self . group_id , & self . artifact_id , & self . version)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/groups/{}/artifacts/{}/versions/{}" , self . client . endpoint () , & self . organization , & self . project , & self . feed , & self . group_id , & self . artifact_id , & self . version)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1285,23 +1211,10 @@ pub mod maven { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1339,29 +1252,35 @@ pub mod maven { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/groups/{}/artifacts/{}/versions/{}" , self . client . endpoint () , & self . organization , & self . project , & self . feed , & self . group_id , & self . artifact_id , & self . version)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/groups/{}/artifacts/{}/versions/{}" , self . client . endpoint () , & self . organization , & self . project , & self . feed , & self . group_id , & self . artifact_id , & self . version)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1389,23 +1308,10 @@ pub mod maven { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1441,24 +1347,28 @@ pub mod maven { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/packagesBatch", self.client.endpoint(), &self.organization, @@ -1467,10 +1377,12 @@ pub mod maven { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1498,37 +1410,13 @@ pub mod maven { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1567,23 +1455,27 @@ pub mod maven { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/maven/{}/{}/{}/{}/content", self.client.endpoint(), &self.organization, @@ -1596,10 +1488,12 @@ pub mod maven { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1624,23 +1518,10 @@ pub mod maven { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1676,24 +1557,28 @@ pub mod maven { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/maven/packagesbatch", self.client.endpoint(), &self.organization, @@ -1702,10 +1587,12 @@ pub mod maven { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2302,37 +2189,15 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2370,23 +2235,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -2398,10 +2267,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2426,37 +2297,15 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2495,24 +2344,28 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -2524,10 +2377,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2552,37 +2407,15 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2620,23 +2453,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -2648,10 +2485,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2676,37 +2515,15 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2743,23 +2560,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -2770,10 +2591,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2798,37 +2621,15 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2866,24 +2667,28 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -2894,10 +2699,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2922,37 +2729,15 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2989,23 +2774,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -3016,10 +2805,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3044,38 +2835,15 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UpstreamingBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3112,23 +2880,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/upstreaming", self.client.endpoint(), &self.organization, @@ -3139,10 +2911,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3167,23 +2941,10 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3221,24 +2982,28 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/upstreaming", self.client.endpoint(), &self.organization, @@ -3249,10 +3014,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3280,37 +3047,13 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3348,23 +3091,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/versions/{}/content", self.client.endpoint(), &self.organization, @@ -3376,10 +3123,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3404,37 +3153,13 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3472,23 +3197,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/versions/{}/readme", self.client.endpoint(), &self.organization, @@ -3500,10 +3229,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3528,38 +3259,15 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UpstreamingBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3595,23 +3303,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/upstreaming", self.client.endpoint(), &self.organization, @@ -3621,10 +3333,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3649,23 +3363,10 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3702,24 +3403,28 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/upstreaming", self.client.endpoint(), &self.organization, @@ -3729,10 +3434,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3760,37 +3467,13 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3827,23 +3510,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/versions/{}/content", self.client.endpoint(), &self.organization, @@ -3854,10 +3541,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3882,37 +3571,13 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3949,23 +3614,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/versions/{}/readme", self.client.endpoint(), &self.organization, @@ -3976,10 +3645,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4004,23 +3675,10 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4056,24 +3714,28 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/packagesbatch", self.client.endpoint(), &self.organization, @@ -4082,10 +3744,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4113,40 +3777,20 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::NpmPackageVersionDeletionState, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::NpmPackageVersionDeletionState = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4184,23 +3828,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/@{}/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -4212,10 +3860,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4241,23 +3891,10 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4296,24 +3933,28 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/@{}/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -4325,10 +3966,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4356,23 +3999,10 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4410,23 +4040,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/@{}/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -4438,10 +4072,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4469,40 +4105,20 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::NpmPackageVersionDeletionState, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::NpmPackageVersionDeletionState = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4539,23 +4155,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -4566,10 +4186,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4595,23 +4217,10 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4649,24 +4258,28 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -4677,10 +4290,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4708,23 +4323,10 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4761,23 +4363,27 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -4788,10 +4394,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4819,23 +4427,10 @@ pub mod npm { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4871,24 +4466,28 @@ pub mod npm { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/PackagesBatch", self.client.endpoint(), &self.organization, @@ -4897,10 +4496,12 @@ pub mod npm { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5212,38 +4813,15 @@ pub mod nu_get { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UpstreamingBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5279,23 +4857,27 @@ pub mod nu_get { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/upstreaming", self.client.endpoint(), &self.organization, @@ -5305,10 +4887,12 @@ pub mod nu_get { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5333,23 +4917,10 @@ pub mod nu_get { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5386,24 +4957,28 @@ pub mod nu_get { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/upstreaming", self.client.endpoint(), &self.organization, @@ -5413,10 +4988,12 @@ pub mod nu_get { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5444,37 +5021,15 @@ pub mod nu_get { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5517,28 +5072,32 @@ pub mod nu_get { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(show_deleted) = &this.show_deleted { req.url_mut() .query_pairs_mut() .append_pair("showDeleted", &show_deleted.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -5549,10 +5108,12 @@ pub mod nu_get { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5577,23 +5138,10 @@ pub mod nu_get { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5631,24 +5179,28 @@ pub mod nu_get { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -5659,10 +5211,12 @@ pub mod nu_get { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5690,37 +5244,15 @@ pub mod nu_get { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5757,23 +5289,27 @@ pub mod nu_get { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -5784,10 +5320,12 @@ pub mod nu_get { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5812,37 +5350,13 @@ pub mod nu_get { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5888,28 +5402,32 @@ pub mod nu_get { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(source_protocol_version) = &this.source_protocol_version { req.url_mut() .query_pairs_mut() .append_pair("sourceProtocolVersion", source_protocol_version); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}/content", self.client.endpoint(), &self.organization, @@ -5920,10 +5438,12 @@ pub mod nu_get { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5948,23 +5468,10 @@ pub mod nu_get { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6000,24 +5507,28 @@ pub mod nu_get { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packagesbatch", self.client.endpoint(), &self.organization, @@ -6026,10 +5537,12 @@ pub mod nu_get { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6057,40 +5570,20 @@ pub mod nu_get { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::NuGetPackageVersionDeletionState, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::NuGetPackageVersionDeletionState = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6127,23 +5620,27 @@ pub mod nu_get { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -6154,10 +5651,12 @@ pub mod nu_get { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6183,23 +5682,10 @@ pub mod nu_get { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6237,24 +5723,28 @@ pub mod nu_get { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -6265,10 +5755,12 @@ pub mod nu_get { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6296,23 +5788,10 @@ pub mod nu_get { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6349,23 +5828,27 @@ pub mod nu_get { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -6376,10 +5859,12 @@ pub mod nu_get { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6407,23 +5892,10 @@ pub mod nu_get { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6459,24 +5931,28 @@ pub mod nu_get { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packagesBatch", self.client.endpoint(), &self.organization, @@ -6485,10 +5961,12 @@ pub mod nu_get { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6802,38 +6280,15 @@ pub mod python { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UpstreamingBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6869,23 +6324,27 @@ pub mod python { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/upstreaming", self.client.endpoint(), &self.organization, @@ -6895,10 +6354,12 @@ pub mod python { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6923,23 +6384,10 @@ pub mod python { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6976,24 +6424,28 @@ pub mod python { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/upstreaming", self.client.endpoint(), &self.organization, @@ -7003,10 +6455,12 @@ pub mod python { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7034,37 +6488,15 @@ pub mod python { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7107,28 +6539,32 @@ pub mod python { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(show_deleted) = &this.show_deleted { req.url_mut() .query_pairs_mut() .append_pair("showDeleted", &show_deleted.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -7139,10 +6575,12 @@ pub mod python { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7167,23 +6605,10 @@ pub mod python { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7221,24 +6646,28 @@ pub mod python { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -7249,10 +6678,12 @@ pub mod python { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7280,37 +6711,15 @@ pub mod python { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7347,23 +6756,27 @@ pub mod python { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -7374,10 +6787,12 @@ pub mod python { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7402,37 +6817,13 @@ pub mod python { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7470,23 +6861,27 @@ pub mod python { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}/{}/content", self.client.endpoint(), &self.organization, @@ -7498,10 +6893,12 @@ pub mod python { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7526,23 +6923,10 @@ pub mod python { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7578,24 +6962,28 @@ pub mod python { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packagesbatch", self.client.endpoint(), &self.organization, @@ -7604,10 +6992,12 @@ pub mod python { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7635,40 +7025,20 @@ pub mod python { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PyPiPackageVersionDeletionState, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PyPiPackageVersionDeletionState = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7705,23 +7075,27 @@ pub mod python { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -7732,10 +7106,12 @@ pub mod python { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7761,23 +7137,10 @@ pub mod python { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7815,24 +7178,28 @@ pub mod python { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -7843,10 +7210,12 @@ pub mod python { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7874,23 +7243,10 @@ pub mod python { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7927,23 +7283,27 @@ pub mod python { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -7954,10 +7314,12 @@ pub mod python { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7985,23 +7347,10 @@ pub mod python { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8037,24 +7386,28 @@ pub mod python { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packagesBatch", self.client.endpoint(), &self.organization, @@ -8063,10 +7416,12 @@ pub mod python { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8304,37 +7659,15 @@ pub mod universal { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8377,28 +7710,32 @@ pub mod universal { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(show_deleted) = &this.show_deleted { req.url_mut() .query_pairs_mut() .append_pair("showDeleted", &show_deleted.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -8409,10 +7746,12 @@ pub mod universal { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8437,23 +7776,10 @@ pub mod universal { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8491,24 +7817,28 @@ pub mod universal { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -8519,10 +7849,12 @@ pub mod universal { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8550,37 +7882,15 @@ pub mod universal { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8617,23 +7927,27 @@ pub mod universal { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -8644,10 +7958,12 @@ pub mod universal { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8672,23 +7988,10 @@ pub mod universal { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8724,24 +8027,28 @@ pub mod universal { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/upack/packagesbatch", self.client.endpoint(), &self.organization, @@ -8750,10 +8057,12 @@ pub mod universal { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8781,40 +8090,20 @@ pub mod universal { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::UPackPackageVersionDeletionState, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UPackPackageVersionDeletionState = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8851,23 +8140,27 @@ pub mod universal { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -8878,10 +8171,12 @@ pub mod universal { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8907,23 +8202,10 @@ pub mod universal { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8961,24 +8243,28 @@ pub mod universal { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -8989,10 +8275,12 @@ pub mod universal { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9020,23 +8308,10 @@ pub mod universal { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9073,23 +8348,27 @@ pub mod universal { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packages/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -9100,10 +8379,12 @@ pub mod universal { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9131,23 +8412,10 @@ pub mod universal { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9183,24 +8451,28 @@ pub mod universal { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packagesBatch", self.client.endpoint(), &self.organization, @@ -9209,10 +8481,12 @@ pub mod universal { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/artifacts_package_types/models.rs b/azure_devops_rust_api/src/artifacts_package_types/models.rs index dbd50188..02ddb591 100644 --- a/azure_devops_rust_api/src/artifacts_package_types/models.rs +++ b/azure_devops_rust_api/src/artifacts_package_types/models.rs @@ -221,7 +221,7 @@ pub struct MavenPackagesBatchRequest { #[doc = "The packages onto which the operation will be performed."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub packages: Vec, @@ -250,7 +250,7 @@ pub mod maven_packages_batch_request { pub struct MavenPomBuild { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub plugins: Vec, @@ -264,7 +264,7 @@ impl MavenPomBuild { pub struct MavenPomCi { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub notifiers: Vec, @@ -282,7 +282,7 @@ impl MavenPomCi { pub struct MavenPomCiNotifier { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub configuration: Vec, @@ -338,7 +338,7 @@ impl MavenPomDependency { pub struct MavenPomDependencyManagement { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dependencies: Vec, @@ -399,7 +399,7 @@ pub struct MavenPomMailingList { #[serde( rename = "otherArchives", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub other_archives: Vec, @@ -429,13 +429,13 @@ pub struct MavenPomMetadata { pub ci_management: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub contributors: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dependencies: Vec, @@ -449,7 +449,7 @@ pub struct MavenPomMetadata { pub description: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub developers: Vec, @@ -473,14 +473,14 @@ pub struct MavenPomMetadata { pub issue_management: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub licenses: Vec, #[serde( rename = "mailingLists", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mailing_lists: Vec, @@ -492,7 +492,7 @@ pub struct MavenPomMetadata { pub model_version: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub modules: Vec, @@ -564,7 +564,7 @@ pub struct MavenPomPerson { pub organization_url: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub roles: Vec, @@ -683,7 +683,7 @@ pub struct NpmPackagesBatchRequest { #[doc = "The packages onto which the operation will be performed."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub packages: Vec, @@ -758,7 +758,7 @@ pub struct NuGetPackagesBatchRequest { #[doc = "The packages onto which the operation will be performed."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub packages: Vec, @@ -828,7 +828,7 @@ pub struct Package { #[serde( rename = "sourceChain", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub source_chain: Vec, @@ -913,7 +913,7 @@ pub struct PyPiPackagesBatchRequest { #[doc = "The packages onto which the operation will be performed."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub packages: Vec, @@ -1007,7 +1007,7 @@ pub struct UPackPackagesBatchRequest { #[doc = "The packages onto which the operation will be performed."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub packages: Vec, diff --git a/azure_devops_rust_api/src/audit/mod.rs b/azure_devops_rust_api/src/audit/mod.rs index 5ed5037a..8408c793 100644 --- a/azure_devops_rust_api/src/audit/mod.rs +++ b/azure_devops_rust_api/src/audit/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://auditservice.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -169,38 +170,15 @@ pub mod actions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditActionInfoList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -239,38 +217,44 @@ pub mod actions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(area_name) = &this.area_name { req.url_mut() .query_pairs_mut() .append_pair("areaName", area_name); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/audit/actions", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -320,38 +304,15 @@ pub mod audit_log { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditLogQueryResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -414,24 +375,31 @@ pub mod audit_log { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(start_time) = &this.start_time { + let formatted_date_time = + crate::date_time::format_date_time(start_time)?; req.url_mut() .query_pairs_mut() - .append_pair("startTime", &start_time.to_string()); + .append_pair("startTime", &formatted_date_time); } if let Some(end_time) = &this.end_time { + let formatted_date_time = crate::date_time::format_date_time(end_time)?; req.url_mut() .query_pairs_mut() - .append_pair("endTime", &end_time.to_string()); + .append_pair("endTime", &formatted_date_time); } if let Some(batch_size) = &this.batch_size { req.url_mut() @@ -448,24 +416,26 @@ pub mod audit_log { .query_pairs_mut() .append_pair("skipAggregation", &skip_aggregation.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/audit/auditlog", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -518,37 +488,13 @@ pub mod download_log { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -594,47 +540,56 @@ pub mod download_log { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let format = &this.format; req.url_mut() .query_pairs_mut() .append_pair("format", format); if let Some(start_time) = &this.start_time { + let formatted_date_time = + crate::date_time::format_date_time(start_time)?; req.url_mut() .query_pairs_mut() - .append_pair("startTime", &start_time.to_string()); + .append_pair("startTime", &formatted_date_time); } if let Some(end_time) = &this.end_time { + let formatted_date_time = crate::date_time::format_date_time(end_time)?; req.url_mut() .query_pairs_mut() - .append_pair("endTime", &end_time.to_string()); + .append_pair("endTime", &formatted_date_time); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/audit/downloadlog", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -768,38 +723,15 @@ pub mod streams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditStreamList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -832,33 +764,39 @@ pub mod streams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/audit/streams", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -883,37 +821,15 @@ pub mod streams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditStream = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -948,38 +864,44 @@ pub mod streams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let days_to_backfill = &this.days_to_backfill; req.url_mut() .query_pairs_mut() .append_pair("daysToBackfill", &days_to_backfill.to_string()); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/audit/streams", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1004,37 +926,15 @@ pub mod streams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditStream = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1068,34 +968,40 @@ pub mod streams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/audit/streams", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1120,37 +1026,15 @@ pub mod streams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditStream = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1184,23 +1068,27 @@ pub mod streams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/audit/streams/{}", self.client.endpoint(), &self.organization, @@ -1208,10 +1096,12 @@ pub mod streams { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1236,37 +1126,15 @@ pub mod streams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditStream = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1301,27 +1169,31 @@ pub mod streams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let status = &this.status; req.url_mut() .query_pairs_mut() .append_pair("status", status); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/audit/streams/{}", self.client.endpoint(), &self.organization, @@ -1329,10 +1201,12 @@ pub mod streams { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1357,23 +1231,10 @@ pub mod streams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1407,23 +1268,27 @@ pub mod streams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/audit/streams/{}", self.client.endpoint(), &self.organization, @@ -1431,10 +1296,12 @@ pub mod streams { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/audit/models.rs b/azure_devops_rust_api/src/audit/models.rs index 545a6d18..a6cba2f6 100644 --- a/azure_devops_rust_api/src/audit/models.rs +++ b/azure_devops_rust_api/src/audit/models.rs @@ -47,7 +47,7 @@ pub struct AuditActionInfoList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -168,7 +168,7 @@ pub struct AuditLogQueryResult { #[serde( rename = "decoratedAuditLogEntries", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub decorated_audit_log_entries: Vec, @@ -265,7 +265,7 @@ pub struct AuditStreamList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/auth.rs b/azure_devops_rust_api/src/auth.rs index 349f7f7b..ee863294 100644 --- a/azure_devops_rust_api/src/auth.rs +++ b/azure_devops_rust_api/src/auth.rs @@ -5,7 +5,7 @@ //! //! For more background information on Azure DevOps authentication see: [Azure DevOps authentication](https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/authentication-guidance) -use azure_core::auth::TokenCredential; +use azure_core::credentials::TokenCredential; use azure_core::error::{Result, ResultExt}; use base64::{prelude::BASE64_STANDARD, Engine}; use std::sync::Arc; @@ -61,7 +61,7 @@ impl Credential { // OAuth tokens are passed using Bearer authentication. Credential::TokenCredential(token_credential) => { let token_response = token_credential - .get_token(scopes) + .get_token(scopes, None) .await .context(azure_core::error::ErrorKind::Other, "get bearer token")?; Ok(Some(format!("Bearer {}", token_response.token.secret()))) diff --git a/azure_devops_rust_api/src/build/mod.rs b/azure_devops_rust_api/src/build/mod.rs index e8c774f5..0ac185c3 100644 --- a/azure_devops_rust_api/src/build/mod.rs +++ b/azure_devops_rust_api/src/build/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -318,37 +319,15 @@ pub mod artifacts { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildArtifact = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -384,27 +363,31 @@ pub mod artifacts { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let artifact_name = &this.artifact_name; req.url_mut() .query_pairs_mut() .append_pair("artifactName", artifact_name); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/artifacts?artifactName={}", self.client.endpoint(), &self.organization, @@ -414,10 +397,12 @@ pub mod artifacts { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -442,37 +427,13 @@ pub mod artifacts { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -510,14 +471,18 @@ pub mod artifacts { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let artifact_name = &this.artifact_name; req.url_mut() @@ -531,20 +496,22 @@ pub mod artifacts { req.url_mut() .query_pairs_mut() .append_pair("fileName", file_name); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/build/builds/{}/artifacts?artifactName={}&fileId={}&fileName={}" , self . client . endpoint () , & self . organization , & self . project , & self . build_id , & self . artifact_name , & self . file_id , & self . file_name)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/build/builds/{}/artifacts?artifactName={}&fileId={}&fileName={}" , self . client . endpoint () , & self . organization , & self . project , & self . build_id , & self . artifact_name , & self . file_id , & self . file_name)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -569,38 +536,15 @@ pub mod artifacts { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildArtifactList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -635,23 +579,27 @@ pub mod artifacts { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/artifacts", self.client.endpoint(), &self.organization, @@ -660,10 +608,12 @@ pub mod artifacts { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -688,37 +638,15 @@ pub mod artifacts { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildArtifact = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -754,24 +682,28 @@ pub mod artifacts { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/artifacts", self.client.endpoint(), &self.organization, @@ -780,10 +712,12 @@ pub mod artifacts { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -953,38 +887,15 @@ pub mod leases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLeaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1031,14 +942,18 @@ pub mod leases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let user_owner_id = &this.user_owner_id; req.url_mut() @@ -1054,14 +969,14 @@ pub mod leases { .query_pairs_mut() .append_pair("runId", &run_id.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/retention/leases?userOwnerId={}", self.client.endpoint(), &self.organization, @@ -1070,10 +985,12 @@ pub mod leases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1098,38 +1015,15 @@ pub mod leases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLeaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1180,14 +1074,18 @@ pub mod leases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(owner_id) = &this.owner_id { req.url_mut() @@ -1204,14 +1102,14 @@ pub mod leases { .query_pairs_mut() .append_pair("runId", &run_id.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/retention/leases?", self.client.endpoint(), &self.organization, @@ -1219,10 +1117,12 @@ pub mod leases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1247,38 +1147,15 @@ pub mod leases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLeaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1313,27 +1190,31 @@ pub mod leases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let leases_to_fetch = &this.leases_to_fetch; req.url_mut() .query_pairs_mut() .append_pair("leasesToFetch", leases_to_fetch); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/retention/leases", self.client.endpoint(), &self.organization, @@ -1341,10 +1222,12 @@ pub mod leases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1369,38 +1252,15 @@ pub mod leases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLeaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1435,24 +1295,28 @@ pub mod leases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/retention/leases", self.client.endpoint(), &self.organization, @@ -1460,10 +1324,12 @@ pub mod leases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1488,23 +1354,10 @@ pub mod leases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1539,25 +1392,29 @@ pub mod leases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let ids = &this.ids; req.url_mut().query_pairs_mut().append_pair("ids", ids); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/retention/leases", self.client.endpoint(), &self.organization, @@ -1565,10 +1422,12 @@ pub mod leases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1596,37 +1455,15 @@ pub mod leases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLease = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1661,23 +1498,27 @@ pub mod leases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/retention/leases/{}", self.client.endpoint(), &self.organization, @@ -1686,10 +1527,12 @@ pub mod leases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1714,37 +1557,15 @@ pub mod leases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLease = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1780,24 +1601,28 @@ pub mod leases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/retention/leases/{}", self.client.endpoint(), &self.organization, @@ -1806,10 +1631,12 @@ pub mod leases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1870,38 +1697,15 @@ pub mod controllers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildControllerList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1939,36 +1743,42 @@ pub mod controllers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(name) = &this.name { req.url_mut().query_pairs_mut().append_pair("name", name); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/build/controllers", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1993,38 +1803,15 @@ pub mod controllers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildController = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2058,23 +1845,27 @@ pub mod controllers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/build/controllers/{}", self.client.endpoint(), &self.organization, @@ -2082,10 +1873,12 @@ pub mod controllers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2130,38 +1923,15 @@ pub mod resource_usage { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildResourceUsage = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2194,33 +1964,39 @@ pub mod resource_usage { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/build/resourceusage", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2266,38 +2042,15 @@ pub mod history { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildRetentionHistory = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2335,38 +2088,44 @@ pub mod history { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(days_to_lookback) = &this.days_to_lookback { req.url_mut() .query_pairs_mut() .append_pair("daysToLookback", &days_to_lookback.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/build/retention/history", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2442,37 +2201,13 @@ pub mod badge { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2513,28 +2248,32 @@ pub mod badge { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(branch_name) = &this.branch_name { req.url_mut() .query_pairs_mut() .append_pair("branchName", branch_name); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/public/build/definitions/{}/{}/badge", self.client.endpoint(), &self.organization, @@ -2543,10 +2282,12 @@ pub mod badge { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2571,37 +2312,13 @@ pub mod badge { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2648,14 +2365,18 @@ pub mod badge { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(repo_id) = &this.repo_id { req.url_mut() @@ -2667,14 +2388,14 @@ pub mod badge { .query_pairs_mut() .append_pair("branchName", branch_name); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/repos/{}/badge", self.client.endpoint(), &self.organization, @@ -2683,10 +2404,12 @@ pub mod badge { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2753,40 +2476,20 @@ pub mod authorizedresources { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::DefinitionResourceReferenceList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DefinitionResourceReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2830,14 +2533,18 @@ pub mod authorizedresources { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(type_) = &this.type_ { req.url_mut().query_pairs_mut().append_pair("type", type_); @@ -2845,14 +2552,14 @@ pub mod authorizedresources { if let Some(id) = &this.id { req.url_mut().query_pairs_mut().append_pair("id", id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/authorizedresources", self.client.endpoint(), &self.organization, @@ -2860,10 +2567,12 @@ pub mod authorizedresources { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2889,40 +2598,20 @@ pub mod authorizedresources { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::DefinitionResourceReferenceList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DefinitionResourceReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2957,24 +2646,28 @@ pub mod authorizedresources { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/authorizedresources", self.client.endpoint(), &self.organization, @@ -2982,10 +2675,12 @@ pub mod authorizedresources { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3327,37 +3022,15 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3511,14 +3184,18 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(definitions) = &this.definitions { req.url_mut() @@ -3536,14 +3213,16 @@ pub mod builds { .append_pair("buildNumber", build_number); } if let Some(min_time) = &this.min_time { + let formatted_date_time = crate::date_time::format_date_time(min_time)?; req.url_mut() .query_pairs_mut() - .append_pair("minTime", &min_time.to_string()); + .append_pair("minTime", &formatted_date_time); } if let Some(max_time) = &this.max_time { + let formatted_date_time = crate::date_time::format_date_time(max_time)?; req.url_mut() .query_pairs_mut() - .append_pair("maxTime", &max_time.to_string()); + .append_pair("maxTime", &formatted_date_time); } if let Some(requested_for) = &this.requested_for { req.url_mut() @@ -3621,14 +3300,14 @@ pub mod builds { .query_pairs_mut() .append_pair("repositoryType", repository_type); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds", self.client.endpoint(), &self.organization, @@ -3636,10 +3315,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3664,37 +3345,15 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Build = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3750,17 +3409,21 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(ignore_warnings) = &this.ignore_warnings { req.url_mut() .query_pairs_mut() @@ -3782,12 +3445,12 @@ pub mod builds { .append_pair("definitionId", &definition_id.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds", self.client.endpoint(), &self.organization, @@ -3795,10 +3458,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3823,37 +3488,15 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3888,24 +3531,28 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds", self.client.endpoint(), &self.organization, @@ -3913,10 +3560,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3941,37 +3590,15 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Build = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4011,28 +3638,32 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(property_filters) = &this.property_filters { req.url_mut() .query_pairs_mut() .append_pair("propertyFilters", property_filters); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}", self.client.endpoint(), &self.organization, @@ -4041,10 +3672,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4069,37 +3702,15 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Build = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4140,29 +3751,33 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(retry) = &this.retry { req.url_mut() .query_pairs_mut() .append_pair("retry", &retry.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}", self.client.endpoint(), &self.organization, @@ -4171,10 +3786,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4199,23 +3816,10 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4250,23 +3854,27 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}", self.client.endpoint(), &self.organization, @@ -4275,10 +3883,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4306,37 +3916,15 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ChangeList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4387,14 +3975,18 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(continuation_token) = &this.continuation_token { req.url_mut() @@ -4412,14 +4004,14 @@ pub mod builds { &include_source_change.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/changes", self.client.endpoint(), &self.organization, @@ -4428,10 +4020,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4456,38 +4050,15 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLeaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4522,23 +4093,27 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/leases", self.client.endpoint(), &self.organization, @@ -4547,10 +4122,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4575,37 +4152,15 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildLogList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4640,23 +4195,27 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/logs", self.client.endpoint(), &self.organization, @@ -4665,10 +4224,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4693,37 +4254,13 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4771,14 +4308,18 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(start_line) = &this.start_line { req.url_mut() @@ -4790,14 +4331,14 @@ pub mod builds { .query_pairs_mut() .append_pair("endLine", &end_line.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/logs/{}", self.client.endpoint(), &self.organization, @@ -4807,10 +4348,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4835,38 +4378,15 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4907,28 +4427,32 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/workitems", self.client.endpoint(), &self.organization, @@ -4937,10 +4461,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4965,38 +4491,15 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5038,29 +4541,33 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(top) = &this.top { req.url_mut() .query_pairs_mut() .append_pair("$top", &top.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/workitems", self.client.endpoint(), &self.organization, @@ -5069,10 +4576,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5097,37 +4606,15 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ChangeList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5179,14 +4666,18 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(from_build_id) = &this.from_build_id { req.url_mut() @@ -5203,14 +4694,14 @@ pub mod builds { .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/changes", self.client.endpoint(), &self.organization, @@ -5218,10 +4709,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5246,38 +4739,15 @@ pub mod builds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5319,14 +4789,18 @@ pub mod builds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let from_build_id = &this.from_build_id; req.url_mut() @@ -5341,14 +4815,14 @@ pub mod builds { .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/workitems", self.client.endpoint(), &self.organization, @@ -5356,10 +4830,12 @@ pub mod builds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5447,37 +4923,13 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5516,23 +4968,27 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/{}/{}/attachments/{}/{}", self.client.endpoint(), &self.organization, @@ -5545,10 +5001,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5573,37 +5031,15 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AttachmentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5639,23 +5075,27 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/attachments/{}", self.client.endpoint(), &self.organization, @@ -5665,10 +5105,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5787,38 +5229,15 @@ pub mod properties { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PropertiesCollection = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5859,28 +5278,32 @@ pub mod properties { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(filter) = &this.filter { req.url_mut() .query_pairs_mut() .append_pair("filter", filter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/properties", self.client.endpoint(), &self.organization, @@ -5889,10 +5312,12 @@ pub mod properties { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5917,38 +5342,15 @@ pub mod properties { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PropertiesCollection = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5984,24 +5386,28 @@ pub mod properties { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/properties", self.client.endpoint(), &self.organization, @@ -6010,10 +5416,12 @@ pub mod properties { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6038,38 +5446,15 @@ pub mod properties { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PropertiesCollection = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6110,28 +5495,32 @@ pub mod properties { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(filter) = &this.filter { req.url_mut() .query_pairs_mut() .append_pair("filter", filter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}/properties", self.client.endpoint(), &self.organization, @@ -6140,10 +5529,12 @@ pub mod properties { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6168,38 +5559,15 @@ pub mod properties { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PropertiesCollection = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6235,24 +5603,28 @@ pub mod properties { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}/properties", self.client.endpoint(), &self.organization, @@ -6261,10 +5633,12 @@ pub mod properties { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6319,38 +5693,15 @@ pub mod report { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildReportMetadata = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6390,26 +5741,30 @@ pub mod report { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(type_) = &this.type_ { req.url_mut().query_pairs_mut().append_pair("type", type_); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/report", self.client.endpoint(), &self.organization, @@ -6418,10 +5773,12 @@ pub mod report { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6478,23 +5835,10 @@ pub mod stages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6531,24 +5875,28 @@ pub mod stages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/stages/{}", self.client.endpoint(), &self.organization, @@ -6558,10 +5906,12 @@ pub mod stages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6849,37 +6199,13 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6914,23 +6240,27 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/tags", self.client.endpoint(), &self.organization, @@ -6939,10 +6269,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6967,37 +6299,13 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7033,24 +6341,28 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/tags", self.client.endpoint(), &self.organization, @@ -7059,10 +6371,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7087,37 +6401,13 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7153,24 +6443,28 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/tags", self.client.endpoint(), &self.organization, @@ -7179,10 +6473,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7207,37 +6503,13 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7273,23 +6545,27 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/tags/{}", self.client.endpoint(), &self.organization, @@ -7299,10 +6575,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7327,37 +6605,13 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7393,23 +6647,27 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/tags/{}", self.client.endpoint(), &self.organization, @@ -7419,10 +6677,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7447,37 +6707,13 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7518,28 +6754,32 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(revision) = &this.revision { req.url_mut() .query_pairs_mut() .append_pair("revision", &revision.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}/tags", self.client.endpoint(), &self.organization, @@ -7548,10 +6788,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7576,37 +6818,13 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7642,24 +6860,28 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}/tags", self.client.endpoint(), &self.organization, @@ -7668,10 +6890,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7696,37 +6920,13 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7762,24 +6962,28 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}/tags", self.client.endpoint(), &self.organization, @@ -7788,10 +6992,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7816,37 +7022,13 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7882,23 +7064,27 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}/tags/{}", self.client.endpoint(), &self.organization, @@ -7908,10 +7094,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7936,37 +7124,13 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8002,23 +7166,27 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}/tags/{}", self.client.endpoint(), &self.organization, @@ -8028,10 +7196,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8056,37 +7226,13 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8120,23 +7266,27 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/tags", self.client.endpoint(), &self.organization, @@ -8144,10 +7294,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8172,37 +7324,13 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8237,23 +7365,27 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/tags/{}", self.client.endpoint(), &self.organization, @@ -8262,10 +7394,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8322,37 +7456,15 @@ pub mod timeline { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Timeline = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + pub struct Response( + azure_core::http::Response, + ); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8398,14 +7510,18 @@ pub mod timeline { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(change_id) = &this.change_id { req.url_mut() @@ -8417,14 +7533,14 @@ pub mod timeline { .query_pairs_mut() .append_pair("planId", plan_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/builds/{}/timeline/{}", self.client.endpoint(), &self.organization, @@ -8434,10 +7550,12 @@ pub mod timeline { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8632,40 +7750,20 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::BuildDefinitionReferenceList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinitionReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8801,14 +7899,18 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(name) = &this.name { req.url_mut().query_pairs_mut().append_pair("name", name); @@ -8839,9 +7941,11 @@ pub mod definitions { .append_pair("continuationToken", continuation_token); } if let Some(min_metrics_time) = &this.min_metrics_time { + let formatted_date_time = + crate::date_time::format_date_time(min_metrics_time)?; req.url_mut() .query_pairs_mut() - .append_pair("minMetricsTime", &min_metrics_time.to_string()); + .append_pair("minMetricsTime", &formatted_date_time); } if let Some(definition_ids) = &this.definition_ids { req.url_mut() @@ -8852,14 +7956,18 @@ pub mod definitions { req.url_mut().query_pairs_mut().append_pair("path", path); } if let Some(built_after) = &this.built_after { + let formatted_date_time = + crate::date_time::format_date_time(built_after)?; req.url_mut() .query_pairs_mut() - .append_pair("builtAfter", &built_after.to_string()); + .append_pair("builtAfter", &formatted_date_time); } if let Some(not_built_after) = &this.not_built_after { + let formatted_date_time = + crate::date_time::format_date_time(not_built_after)?; req.url_mut() .query_pairs_mut() - .append_pair("notBuiltAfter", ¬_built_after.to_string()); + .append_pair("notBuiltAfter", &formatted_date_time); } if let Some(include_all_properties) = &this.include_all_properties { req.url_mut().query_pairs_mut().append_pair( @@ -8888,14 +7996,14 @@ pub mod definitions { .query_pairs_mut() .append_pair("yamlFilename", yaml_filename); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions", self.client.endpoint(), &self.organization, @@ -8903,10 +8011,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8932,38 +8042,15 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9011,17 +8098,21 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(definition_to_clone_id) = &this.definition_to_clone_id { req.url_mut().query_pairs_mut().append_pair( "definitionToCloneId", @@ -9037,12 +8128,12 @@ pub mod definitions { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions", self.client.endpoint(), &self.organization, @@ -9050,10 +8141,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9078,38 +8171,15 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9170,14 +8240,18 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(revision) = &this.revision { req.url_mut() @@ -9185,9 +8259,11 @@ pub mod definitions { .append_pair("revision", &revision.to_string()); } if let Some(min_metrics_time) = &this.min_metrics_time { + let formatted_date_time = + crate::date_time::format_date_time(min_metrics_time)?; req.url_mut() .query_pairs_mut() - .append_pair("minMetricsTime", &min_metrics_time.to_string()); + .append_pair("minMetricsTime", &formatted_date_time); } if let Some(property_filters) = &this.property_filters { req.url_mut() @@ -9200,14 +8276,14 @@ pub mod definitions { &include_latest_builds.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}", self.client.endpoint(), &self.organization, @@ -9216,10 +8292,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9244,38 +8322,15 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9327,17 +8382,21 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(secrets_source_definition_id) = &this.secrets_source_definition_id { @@ -9355,12 +8414,12 @@ pub mod definitions { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}", self.client.endpoint(), &self.organization, @@ -9369,10 +8428,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9397,38 +8458,15 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9464,27 +8502,31 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let deleted = &this.deleted; req.url_mut() .query_pairs_mut() .append_pair("deleted", &deleted.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}", self.client.endpoint(), &self.organization, @@ -9493,10 +8535,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9521,23 +8565,10 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9572,23 +8603,27 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}", self.client.endpoint(), &self.organization, @@ -9597,10 +8632,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9628,40 +8665,20 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::BuildDefinitionRevisionList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinitionRevisionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9696,23 +8713,27 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}/revisions", self.client.endpoint(), &self.organization, @@ -9721,10 +8742,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9800,38 +8823,15 @@ pub mod metrics { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildMetricList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9875,28 +8875,34 @@ pub mod metrics { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(min_metrics_time) = &this.min_metrics_time { + let formatted_date_time = + crate::date_time::format_date_time(min_metrics_time)?; req.url_mut() .query_pairs_mut() - .append_pair("minMetricsTime", &min_metrics_time.to_string()); + .append_pair("minMetricsTime", &formatted_date_time); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}/metrics", self.client.endpoint(), &self.organization, @@ -9905,10 +8911,12 @@ pub mod metrics { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9933,38 +8941,15 @@ pub mod metrics { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildMetricList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10008,28 +8993,34 @@ pub mod metrics { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(min_metrics_time) = &this.min_metrics_time { + let formatted_date_time = + crate::date_time::format_date_time(min_metrics_time)?; req.url_mut() .query_pairs_mut() - .append_pair("minMetricsTime", &min_metrics_time.to_string()); + .append_pair("minMetricsTime", &formatted_date_time); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/metrics/{}", self.client.endpoint(), &self.organization, @@ -10038,10 +9029,12 @@ pub mod metrics { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10110,40 +9103,20 @@ pub mod resources { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::DefinitionResourceReferenceList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DefinitionResourceReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10178,23 +9151,27 @@ pub mod resources { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}/resources", self.client.endpoint(), &self.organization, @@ -10203,10 +9180,12 @@ pub mod resources { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10232,40 +9211,20 @@ pub mod resources { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::DefinitionResourceReferenceList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DefinitionResourceReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10301,24 +9260,28 @@ pub mod resources { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}/resources", self.client.endpoint(), &self.organization, @@ -10327,10 +9290,12 @@ pub mod resources { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10389,37 +9354,15 @@ pub mod yaml { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::YamlBuild = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10480,14 +9423,18 @@ pub mod yaml { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(revision) = &this.revision { req.url_mut() @@ -10495,9 +9442,11 @@ pub mod yaml { .append_pair("revision", &revision.to_string()); } if let Some(min_metrics_time) = &this.min_metrics_time { + let formatted_date_time = + crate::date_time::format_date_time(min_metrics_time)?; req.url_mut() .query_pairs_mut() - .append_pair("minMetricsTime", &min_metrics_time.to_string()); + .append_pair("minMetricsTime", &formatted_date_time); } if let Some(property_filters) = &this.property_filters { req.url_mut() @@ -10510,14 +9459,14 @@ pub mod yaml { &include_latest_builds.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/{}/yaml", self.client.endpoint(), &self.organization, @@ -10526,10 +9475,12 @@ pub mod yaml { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10640,40 +9591,20 @@ pub mod templates { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::BuildDefinitionTemplateList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinitionTemplateList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10707,23 +9638,27 @@ pub mod templates { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/templates", self.client.endpoint(), &self.organization, @@ -10731,10 +9666,12 @@ pub mod templates { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10760,38 +9697,18 @@ pub mod templates { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::BuildDefinitionTemplate, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinitionTemplate = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10826,23 +9743,27 @@ pub mod templates { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/templates/{}", self.client.endpoint(), &self.organization, @@ -10851,10 +9772,12 @@ pub mod templates { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10880,38 +9803,18 @@ pub mod templates { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::BuildDefinitionTemplate, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinitionTemplate = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10947,24 +9850,28 @@ pub mod templates { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/templates/{}", self.client.endpoint(), &self.organization, @@ -10973,10 +9880,12 @@ pub mod templates { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11002,23 +9911,10 @@ pub mod templates { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11053,23 +9949,27 @@ pub mod templates { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/definitions/templates/{}", self.client.endpoint(), &self.organization, @@ -11078,10 +9978,12 @@ pub mod templates { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11202,37 +10104,15 @@ pub mod folders { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11268,26 +10148,30 @@ pub mod folders { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let path = &this.path; req.url_mut().query_pairs_mut().append_pair("path", path); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/folders", self.client.endpoint(), &self.organization, @@ -11295,10 +10179,12 @@ pub mod folders { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11323,37 +10209,15 @@ pub mod folders { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11389,26 +10253,30 @@ pub mod folders { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let path = &this.path; req.url_mut().query_pairs_mut().append_pair("path", path); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/folders", self.client.endpoint(), &self.organization, @@ -11416,10 +10284,12 @@ pub mod folders { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11444,23 +10314,10 @@ pub mod folders { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11495,25 +10352,29 @@ pub mod folders { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let path = &this.path; req.url_mut().query_pairs_mut().append_pair("path", path); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/folders", self.client.endpoint(), &self.organization, @@ -11521,10 +10382,12 @@ pub mod folders { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11552,37 +10415,15 @@ pub mod folders { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FolderList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11623,28 +10464,32 @@ pub mod folders { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(query_order) = &this.query_order { req.url_mut() .query_pairs_mut() .append_pair("queryOrder", query_order); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/folders/{}", self.client.endpoint(), &self.organization, @@ -11653,10 +10498,12 @@ pub mod folders { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11725,38 +10572,18 @@ pub mod general_settings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PipelineGeneralSettings, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PipelineGeneralSettings = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11790,23 +10617,27 @@ pub mod general_settings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/generalsettings", self.client.endpoint(), &self.organization, @@ -11814,10 +10645,12 @@ pub mod general_settings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11843,38 +10676,18 @@ pub mod general_settings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PipelineGeneralSettings, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PipelineGeneralSettings = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11909,24 +10722,28 @@ pub mod general_settings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/generalsettings", self.client.endpoint(), &self.organization, @@ -11934,10 +10751,12 @@ pub mod general_settings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11993,37 +10812,15 @@ pub mod latest { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Build = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12064,28 +10861,32 @@ pub mod latest { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(branch_name) = &this.branch_name { req.url_mut() .query_pairs_mut() .append_pair("branchName", branch_name); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/latest/{}", self.client.endpoint(), &self.organization, @@ -12094,10 +10895,12 @@ pub mod latest { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12148,38 +10951,18 @@ pub mod options { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::BuildOptionDefinitionList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildOptionDefinitionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12213,23 +10996,27 @@ pub mod options { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/options", self.client.endpoint(), &self.organization, @@ -12237,10 +11024,12 @@ pub mod options { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12310,38 +11099,18 @@ pub mod retention { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ProjectRetentionSetting, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProjectRetentionSetting = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12375,23 +11144,27 @@ pub mod retention { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/retention", self.client.endpoint(), &self.organization, @@ -12399,10 +11172,12 @@ pub mod retention { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12428,38 +11203,18 @@ pub mod retention { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ProjectRetentionSetting, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProjectRetentionSetting = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12494,24 +11249,28 @@ pub mod retention { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/retention", self.client.endpoint(), &self.organization, @@ -12519,10 +11278,12 @@ pub mod retention { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12593,37 +11354,15 @@ pub mod settings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildSettings = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12657,23 +11396,27 @@ pub mod settings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/settings", self.client.endpoint(), &self.organization, @@ -12681,10 +11424,12 @@ pub mod settings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12709,37 +11454,15 @@ pub mod settings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildSettings = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12774,24 +11497,28 @@ pub mod settings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/settings", self.client.endpoint(), &self.organization, @@ -12799,10 +11526,12 @@ pub mod settings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12861,37 +11590,13 @@ pub mod status { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12956,14 +11661,18 @@ pub mod status { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(branch_name) = &this.branch_name { req.url_mut() @@ -12988,14 +11697,14 @@ pub mod status { if let Some(label) = &this.label { req.url_mut().query_pairs_mut().append_pair("label", label); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/build/status/{}", self.client.endpoint(), &self.organization, @@ -13004,10 +11713,12 @@ pub mod status { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13219,40 +11930,20 @@ pub mod source_providers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::SourceProviderAttributesList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SourceProviderAttributesList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13286,23 +11977,27 @@ pub mod source_providers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/sourceproviders", self.client.endpoint(), &self.organization, @@ -13310,10 +12005,12 @@ pub mod source_providers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13339,37 +12036,13 @@ pub mod source_providers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13422,14 +12095,18 @@ pub mod source_providers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(service_endpoint_id) = &this.service_endpoint_id { req.url_mut() @@ -13446,14 +12123,14 @@ pub mod source_providers { .query_pairs_mut() .append_pair("branchName", branch_name); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/sourceProviders/{}/branches", self.client.endpoint(), &self.organization, @@ -13462,10 +12139,12 @@ pub mod source_providers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13490,37 +12169,13 @@ pub mod source_providers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13579,14 +12234,18 @@ pub mod source_providers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(service_endpoint_id) = &this.service_endpoint_id { req.url_mut() @@ -13606,14 +12265,14 @@ pub mod source_providers { if let Some(path) = &this.path { req.url_mut().query_pairs_mut().append_pair("path", path); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/sourceProviders/{}/filecontents", self.client.endpoint(), &self.organization, @@ -13622,10 +12281,12 @@ pub mod source_providers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13650,38 +12311,18 @@ pub mod source_providers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::SourceRepositoryItemList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SourceRepositoryItemList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13740,14 +12381,18 @@ pub mod source_providers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(service_endpoint_id) = &this.service_endpoint_id { req.url_mut() @@ -13767,14 +12412,14 @@ pub mod source_providers { if let Some(path) = &this.path { req.url_mut().query_pairs_mut().append_pair("path", path); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/sourceProviders/{}/pathcontents", self.client.endpoint(), &self.organization, @@ -13783,10 +12428,12 @@ pub mod source_providers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13812,37 +12459,15 @@ pub mod source_providers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PullRequest = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13890,14 +12515,18 @@ pub mod source_providers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(repository_id) = &this.repository_id { req.url_mut() @@ -13909,14 +12538,14 @@ pub mod source_providers { .query_pairs_mut() .append_pair("serviceEndpointId", service_endpoint_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/sourceProviders/{}/pullrequests/{}", self.client.endpoint(), &self.organization, @@ -13926,10 +12555,12 @@ pub mod source_providers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13954,38 +12585,15 @@ pub mod source_providers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SourceRepositories = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14050,14 +12658,18 @@ pub mod source_providers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(service_endpoint_id) = &this.service_endpoint_id { req.url_mut() @@ -14084,14 +12696,14 @@ pub mod source_providers { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/sourceProviders/{}/repositories", self.client.endpoint(), &self.organization, @@ -14100,10 +12712,12 @@ pub mod source_providers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14128,38 +12742,15 @@ pub mod source_providers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RepositoryWebhookList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14206,14 +12797,18 @@ pub mod source_providers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(service_endpoint_id) = &this.service_endpoint_id { req.url_mut() @@ -14225,14 +12820,14 @@ pub mod source_providers { .query_pairs_mut() .append_pair("repository", repository); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/sourceProviders/{}/webhooks", self.client.endpoint(), &self.organization, @@ -14241,10 +12836,12 @@ pub mod source_providers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14269,23 +12866,10 @@ pub mod source_providers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14333,17 +12917,21 @@ pub mod source_providers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(service_endpoint_id) = &this.service_endpoint_id { req.url_mut() .query_pairs_mut() @@ -14355,12 +12943,12 @@ pub mod source_providers { .append_pair("repository", repository); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/sourceProviders/{}/webhooks", self.client.endpoint(), &self.organization, @@ -14369,10 +12957,12 @@ pub mod source_providers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/build/models.rs b/azure_devops_rust_api/src/build/models.rs index f14b60c1..f831cb4e 100644 --- a/azure_devops_rust_api/src/build/models.rs +++ b/azure_devops_rust_api/src/build/models.rs @@ -14,20 +14,22 @@ pub struct AgentPoolQueue { #[doc = "The ID of the queue."] pub id: i32, #[doc = "The name of the queue."] - pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, #[doc = "Represents a reference to an agent pool."] - pub pool: TaskAgentPoolReference, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pool: Option, #[doc = "The full http link to the resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub url: Option, } impl AgentPoolQueue { - pub fn new(id: i32, name: String, pool: TaskAgentPoolReference) -> Self { + pub fn new(id: i32) -> Self { Self { links: None, id, - name, - pool, + name: None, + pool: None, url: None, } } @@ -67,7 +69,7 @@ pub struct AgentPoolQueueTarget { pub allow_scripts_auth_access_option: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub demands: Vec, @@ -422,7 +424,7 @@ pub struct AttachmentList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -505,7 +507,7 @@ pub struct Build { #[doc = "A list of demands that represents the agent capabilities required by this build."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub demands: Vec, @@ -549,7 +551,7 @@ pub struct Build { #[doc = "Orchestration plans associated with the build (build, cleanup)"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub plans: Vec, @@ -642,7 +644,7 @@ pub struct Build { pub status: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -676,7 +678,7 @@ pub struct Build { #[serde( rename = "validationResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub validation_results: Vec, @@ -946,7 +948,7 @@ pub struct BuildArtifactList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -978,7 +980,7 @@ pub struct BuildCompletedEvent { #[doc = "Changes associated with a build used for build notifications"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub changes: Vec, @@ -999,7 +1001,7 @@ pub struct BuildCompletedEvent { #[serde( rename = "timelineRecords", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub timeline_records: Vec, @@ -1007,7 +1009,7 @@ pub struct BuildCompletedEvent { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec, @@ -1025,7 +1027,7 @@ pub struct BuildCompletionTrigger { #[serde( rename = "branchFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub branch_filters: Vec, @@ -1104,7 +1106,7 @@ pub struct BuildControllerList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1138,7 +1140,7 @@ pub struct BuildDefinition { pub comment: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub demands: Vec, @@ -1175,7 +1177,7 @@ pub struct BuildDefinition { pub job_timeout_in_minutes: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub options: Vec, @@ -1197,26 +1199,26 @@ pub struct BuildDefinition { #[serde( rename = "retentionRules", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub retention_rules: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub triggers: Vec, #[serde( rename = "variableGroups", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub variable_groups: Vec, @@ -1274,7 +1276,7 @@ pub struct BuildDefinition32 { pub badge_enabled: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub build: Vec, @@ -1290,7 +1292,7 @@ pub struct BuildDefinition32 { pub comment: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub demands: Vec, @@ -1341,7 +1343,7 @@ pub struct BuildDefinition32 { pub latest_completed_build: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub options: Vec, @@ -1360,19 +1362,19 @@ pub struct BuildDefinition32 { #[serde( rename = "retentionRules", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub retention_rules: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub triggers: Vec, @@ -1437,7 +1439,7 @@ pub struct BuildDefinitionReference { #[doc = "The list of drafts associated with this definition, if this is not a draft definition."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub drafts: Vec, @@ -1457,7 +1459,7 @@ pub struct BuildDefinitionReference { pub latest_completed_build: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub metrics: Vec, @@ -1515,13 +1517,13 @@ pub struct BuildDefinitionReference32 { #[doc = "The list of drafts associated with this definition, if this is not a draft definition."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub drafts: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub metrics: Vec, @@ -1563,7 +1565,7 @@ pub struct BuildDefinitionReferenceList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1634,7 +1636,7 @@ pub struct BuildDefinitionRevisionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1849,7 +1851,7 @@ pub struct BuildDefinitionTemplateList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1914,7 +1916,7 @@ impl BuildDeployment { pub struct BuildEvent { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub data: Vec, @@ -1932,7 +1934,7 @@ pub struct BuildList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1983,7 +1985,7 @@ pub struct BuildLogList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2040,7 +2042,7 @@ pub struct BuildMetricList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2078,14 +2080,14 @@ pub struct BuildOptionDefinition { #[doc = "The list of input groups defined for the build option."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub groups: Vec, #[doc = "The list of inputs defined for the build option."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub inputs: Vec, @@ -2107,7 +2109,7 @@ pub struct BuildOptionDefinitionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2235,26 +2237,26 @@ impl BuildProcess { pub struct BuildProcessResources { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub endpoints: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub files: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub queues: Vec, #[serde( rename = "variableGroups", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub variable_groups: Vec, @@ -2607,7 +2609,7 @@ pub struct BuildRetentionHistory { #[serde( rename = "buildRetentionSamples", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub build_retention_samples: Vec, @@ -2647,7 +2649,7 @@ impl BuildRetentionSample { pub struct BuildServer { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub agents: Vec, @@ -2832,14 +2834,14 @@ pub struct BuildTagsAddedEvent { #[serde( rename = "allTags", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub all_tags: Vec, #[serde( rename = "newTags", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub new_tags: Vec, @@ -2908,7 +2910,7 @@ impl BuildUpdatedEvent { pub struct BuildWorkspace { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mappings: Vec, @@ -2933,7 +2935,7 @@ pub struct BuildsDeletedEvent1 { #[serde( rename = "buildIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub build_ids: Vec, @@ -3006,7 +3008,7 @@ pub struct ChangeList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3022,7 +3024,7 @@ pub struct ConsoleLogEvent { pub realtime_build_event: RealtimeBuildEvent, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub lines: Vec, @@ -3114,7 +3116,7 @@ pub struct ContinuousIntegrationTrigger { #[serde( rename = "branchFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub branch_filters: Vec, @@ -3128,7 +3130,7 @@ pub struct ContinuousIntegrationTrigger { #[serde( rename = "pathFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub path_filters: Vec, @@ -3199,7 +3201,7 @@ pub struct DataSourceBindingBase { #[doc = "Gets or sets the authorization headers."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub headers: Vec, @@ -3354,7 +3356,7 @@ pub struct DefinitionResourceReferenceList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3451,7 +3453,7 @@ pub struct DesignerProcess { pub build_process: BuildProcess, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub phases: Vec, @@ -3552,7 +3554,7 @@ pub struct FolderList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3596,7 +3598,7 @@ pub struct GatedCheckInTrigger { #[serde( rename = "pathFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub path_filters: Vec, @@ -3965,7 +3967,7 @@ pub struct Phase { pub condition: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dependencies: Vec, @@ -3998,7 +4000,7 @@ pub struct Phase { pub ref_name: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub steps: Vec, @@ -4293,20 +4295,20 @@ pub struct ProcessParameters { #[serde( rename = "dataSourceBindings", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub data_source_bindings: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub inputs: Vec, #[serde( rename = "sourceDefinitions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub source_definitions: Vec, @@ -4360,14 +4362,14 @@ pub struct PropertiesCollection { #[doc = "The set of keys in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub keys: Vec, #[doc = "The set of values in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -4460,7 +4462,7 @@ pub struct PullRequestTrigger { #[serde( rename = "branchFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub branch_filters: Vec, @@ -4476,7 +4478,7 @@ pub struct PullRequestTrigger { #[serde( rename = "pathFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub path_filters: Vec, @@ -4626,7 +4628,7 @@ pub struct RepositoryWebhook { pub name: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub types: Vec, @@ -4645,7 +4647,7 @@ pub struct RepositoryWebhookList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4673,7 +4675,7 @@ pub struct ResourceRefList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4749,7 +4751,7 @@ pub struct RetentionLeaseList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4783,20 +4785,20 @@ impl RetentionLeaseUpdate { pub struct RetentionPolicy { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub artifacts: Vec, #[serde( rename = "artifactTypesToDelete", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub artifact_types_to_delete: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub branches: Vec, @@ -4854,7 +4856,7 @@ pub struct Schedule { #[serde( rename = "branchFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub branch_filters: Vec, @@ -4938,7 +4940,7 @@ pub struct ScheduleTrigger { pub build_trigger: BuildTrigger, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub schedules: Vec, @@ -5022,7 +5024,7 @@ pub struct SourceProviderAttributes { #[serde( rename = "supportedTriggers", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub supported_triggers: Vec, @@ -5038,7 +5040,7 @@ pub struct SourceProviderAttributesList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -5112,7 +5114,7 @@ pub struct SourceRepositories { #[doc = "A list of repositories"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub repositories: Vec, @@ -5197,7 +5199,7 @@ pub struct SourceRepositoryItemList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -5316,7 +5318,7 @@ impl SvnMappingDetails { pub struct SvnWorkspace { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mappings: Vec, @@ -5376,7 +5378,7 @@ impl TaskDefinitionReference { pub struct TaskInputDefinitionBase { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub aliases: Vec, @@ -5454,7 +5456,7 @@ pub struct TaskOrchestrationPlanGroupsStartedEvent { #[serde( rename = "planGroups", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub plan_groups: Vec, @@ -5677,7 +5679,7 @@ pub struct Timeline { pub last_changed_on: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub records: Vec, @@ -5753,7 +5755,7 @@ pub struct TimelineRecord { pub identifier: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub issues: Vec, @@ -5787,7 +5789,7 @@ pub struct TimelineRecord { #[serde( rename = "previousAttempts", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub previous_attempts: Vec, @@ -5880,7 +5882,7 @@ pub struct TimelineRecordsUpdatedEvent { #[serde( rename = "timelineRecords", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub timeline_records: Vec, @@ -5982,14 +5984,14 @@ pub struct UpdateTagParameters { #[serde( rename = "tagsToAdd", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags_to_add: Vec, #[serde( rename = "tagsToRemove", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags_to_remove: Vec, @@ -6057,7 +6059,7 @@ pub struct VariableMultipliersAgentExecutionOptions { pub max_concurrency: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub multipliers: Vec, @@ -6088,7 +6090,7 @@ pub struct VariableMultipliersServerExecutionOptions { pub max_concurrency: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub multipliers: Vec, @@ -6216,7 +6218,7 @@ pub struct WorkspaceTemplate { #[doc = "List of workspace mappings"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mappings: Vec, @@ -6455,7 +6457,7 @@ pub struct YamlProcess { pub build_process: BuildProcess, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub errors: Vec, diff --git a/azure_devops_rust_api/src/clt/mod.rs b/azure_devops_rust_api/src/clt/mod.rs index 6330d735..3e90b387 100644 --- a/azure_devops_rust_api/src/clt/mod.rs +++ b/azure_devops_rust_api/src/clt/mod.rs @@ -87,8 +87,8 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { + request: &mut azure_core::http::Request, + ) -> azure_core::Result { let mut context = azure_core::Context::default(); self.pipeline.send(&mut context, request).await } diff --git a/azure_devops_rust_api/src/core/mod.rs b/azure_devops_rust_api/src/core/mod.rs index f5a52d1a..9fe42a8c 100644 --- a/azure_devops_rust_api/src/core/mod.rs +++ b/azure_devops_rust_api/src/core/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -187,37 +188,15 @@ pub mod processes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -250,33 +229,39 @@ pub mod processes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/process/processes", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -301,37 +286,15 @@ pub mod processes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Process = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -365,23 +328,27 @@ pub mod processes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/process/processes/{}", self.client.endpoint(), &self.organization, @@ -389,10 +356,12 @@ pub mod processes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -546,38 +515,18 @@ pub mod projects { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TeamProjectReferenceList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamProjectReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -637,14 +586,18 @@ pub mod projects { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(state_filter) = &this.state_filter { req.url_mut() @@ -672,24 +625,26 @@ pub mod projects { &get_default_team_image_url.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -715,38 +670,15 @@ pub mod projects { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -780,34 +712,40 @@ pub mod projects { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -832,37 +770,15 @@ pub mod projects { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamProject = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -908,14 +824,18 @@ pub mod projects { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_capabilities) = &this.include_capabilities { req.url_mut().query_pairs_mut().append_pair( @@ -928,14 +848,14 @@ pub mod projects { .query_pairs_mut() .append_pair("includeHistory", &include_history.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}", self.client.endpoint(), &self.organization, @@ -943,10 +863,12 @@ pub mod projects { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -971,38 +893,15 @@ pub mod projects { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1037,24 +936,28 @@ pub mod projects { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}", self.client.endpoint(), &self.organization, @@ -1062,10 +965,12 @@ pub mod projects { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1090,38 +995,15 @@ pub mod projects { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1155,23 +1037,27 @@ pub mod projects { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}", self.client.endpoint(), &self.organization, @@ -1179,10 +1065,12 @@ pub mod projects { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1207,38 +1095,15 @@ pub mod projects { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProjectPropertyList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1278,26 +1143,30 @@ pub mod projects { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(keys) = &this.keys { req.url_mut().query_pairs_mut().append_pair("keys", keys); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}/properties", self.client.endpoint(), &self.organization, @@ -1305,10 +1174,12 @@ pub mod projects { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1333,23 +1204,10 @@ pub mod projects { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1384,24 +1242,28 @@ pub mod projects { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}/properties", self.client.endpoint(), &self.organization, @@ -1409,10 +1271,12 @@ pub mod projects { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1485,23 +1349,10 @@ pub mod avatar { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1536,24 +1387,28 @@ pub mod avatar { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}/avatar", self.client.endpoint(), &self.organization, @@ -1561,10 +1416,12 @@ pub mod avatar { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1592,23 +1449,10 @@ pub mod avatar { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1642,23 +1486,27 @@ pub mod avatar { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}/avatar", self.client.endpoint(), &self.organization, @@ -1666,10 +1514,12 @@ pub mod avatar { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1726,38 +1576,18 @@ pub mod categorized_teams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::CategorizedWebApiTeams, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CategorizedWebApiTeams = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1809,14 +1639,18 @@ pub mod categorized_teams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand_identity) = &this.expand_identity { req.url_mut() @@ -1833,14 +1667,14 @@ pub mod categorized_teams { .query_pairs_mut() .append_pair("$skip", &skip.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}/categorizedteams/", self.client.endpoint(), &self.organization, @@ -1848,10 +1682,12 @@ pub mod categorized_teams { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2023,37 +1859,15 @@ pub mod teams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTeamList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2111,14 +1925,18 @@ pub mod teams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(mine) = &this.mine { req.url_mut() @@ -2140,14 +1958,14 @@ pub mod teams { .query_pairs_mut() .append_pair("$expandIdentity", &expand_identity.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}/teams", self.client.endpoint(), &self.organization, @@ -2155,10 +1973,12 @@ pub mod teams { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2183,37 +2003,15 @@ pub mod teams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTeam = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2248,24 +2046,28 @@ pub mod teams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}/teams", self.client.endpoint(), &self.organization, @@ -2273,10 +2075,12 @@ pub mod teams { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2301,37 +2105,15 @@ pub mod teams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTeam = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2372,28 +2154,32 @@ pub mod teams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand_identity) = &this.expand_identity { req.url_mut() .query_pairs_mut() .append_pair("$expandIdentity", &expand_identity.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}/teams/{}", self.client.endpoint(), &self.organization, @@ -2402,10 +2188,12 @@ pub mod teams { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2430,37 +2218,15 @@ pub mod teams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTeam = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2496,24 +2262,28 @@ pub mod teams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}/teams/{}", self.client.endpoint(), &self.organization, @@ -2522,10 +2292,12 @@ pub mod teams { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2550,23 +2322,10 @@ pub mod teams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2601,23 +2360,27 @@ pub mod teams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}/teams/{}", self.client.endpoint(), &self.organization, @@ -2626,10 +2389,12 @@ pub mod teams { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2657,37 +2422,15 @@ pub mod teams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamMemberList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2732,14 +2475,18 @@ pub mod teams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -2751,14 +2498,14 @@ pub mod teams { .query_pairs_mut() .append_pair("$skip", &skip.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/projects/{}/teams/{}/members", self.client.endpoint(), &self.organization, @@ -2767,10 +2514,12 @@ pub mod teams { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2795,37 +2544,15 @@ pub mod teams { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTeamList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2882,14 +2609,18 @@ pub mod teams { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(mine) = &this.mine { req.url_mut() @@ -2911,24 +2642,26 @@ pub mod teams { .query_pairs_mut() .append_pair("$expandIdentity", &expand_identity.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/teams", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/core/models.rs b/azure_devops_rust_api/src/core/models.rs index 13023614..64d54caf 100644 --- a/azure_devops_rust_api/src/core/models.rs +++ b/azure_devops_rust_api/src/core/models.rs @@ -11,7 +11,7 @@ pub struct CategorizedWebApiTeams { #[serde( rename = "myTeams", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub my_teams: Vec, @@ -19,7 +19,7 @@ pub struct CategorizedWebApiTeams { #[serde( rename = "otherReadableTeams", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub other_readable_teams: Vec, @@ -94,20 +94,20 @@ pub struct IdentityBase { #[serde( rename = "memberIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub member_ids: Vec, #[serde( rename = "memberOf", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub member_of: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub members: Vec, @@ -163,7 +163,7 @@ pub struct IdentityData { #[serde( rename = "identityIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub identity_ids: Vec, @@ -378,7 +378,7 @@ pub struct ProcessList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -406,7 +406,7 @@ pub struct ProjectAvatar { #[doc = "The avatar image represented as a byte array."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub image: Vec, @@ -442,7 +442,7 @@ pub struct ProjectInfo { #[doc = "A set of name-value pairs storing additional property data related to the project."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub properties: Vec, @@ -539,7 +539,7 @@ pub struct ProjectProperties { #[doc = "The collection of team project properties"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub properties: Vec, @@ -570,7 +570,7 @@ pub struct ProjectPropertyList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -591,14 +591,14 @@ pub struct PropertiesCollection { #[doc = "The set of keys in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub keys: Vec, #[doc = "The set of values in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -676,14 +676,14 @@ pub struct PublicKey { #[doc = "Gets or sets the exponent for the public key."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub exponent: Vec, #[doc = "Gets or sets the modulus for the public key."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub modulus: Vec, @@ -748,7 +748,7 @@ pub struct TeamMemberList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -943,7 +943,7 @@ pub struct TeamProjectReferenceList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1249,7 +1249,7 @@ pub struct WebApiTeamList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/dashboard/mod.rs b/azure_devops_rust_api/src/dashboard/mod.rs index beeb925d..7d4c5c46 100644 --- a/azure_devops_rust_api/src/dashboard/mod.rs +++ b/azure_devops_rust_api/src/dashboard/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -192,38 +193,15 @@ pub mod widget_types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WidgetTypesResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -258,25 +236,29 @@ pub mod widget_types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let scope = &this.scope; req.url_mut().query_pairs_mut().append_pair("$scope", scope); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/dashboard/widgettypes", self.client.endpoint(), &self.organization, @@ -284,10 +266,12 @@ pub mod widget_types { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -312,38 +296,18 @@ pub mod widget_types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WidgetMetadataResponse, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WidgetMetadataResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -378,23 +342,27 @@ pub mod widget_types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/dashboard/widgettypes/{}", self.client.endpoint(), &self.organization, @@ -403,10 +371,12 @@ pub mod widget_types { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -572,37 +542,15 @@ pub mod dashboards { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DashboardList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -637,23 +585,27 @@ pub mod dashboards { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards", self.client.endpoint(), &self.organization, @@ -662,10 +614,12 @@ pub mod dashboards { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -690,37 +644,15 @@ pub mod dashboards { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Dashboard = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -756,24 +688,28 @@ pub mod dashboards { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards", self.client.endpoint(), &self.organization, @@ -782,10 +718,12 @@ pub mod dashboards { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -810,37 +748,15 @@ pub mod dashboards { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DashboardGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -876,24 +792,28 @@ pub mod dashboards { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards", self.client.endpoint(), &self.organization, @@ -902,10 +822,12 @@ pub mod dashboards { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -930,37 +852,15 @@ pub mod dashboards { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Dashboard = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -996,23 +896,27 @@ pub mod dashboards { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", self.client.endpoint(), &self.organization, @@ -1022,10 +926,12 @@ pub mod dashboards { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1050,37 +956,15 @@ pub mod dashboards { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Dashboard = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1117,24 +1001,28 @@ pub mod dashboards { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", self.client.endpoint(), &self.organization, @@ -1144,10 +1032,12 @@ pub mod dashboards { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1172,23 +1062,10 @@ pub mod dashboards { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1224,23 +1101,27 @@ pub mod dashboards { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", self.client.endpoint(), &self.organization, @@ -1250,10 +1131,12 @@ pub mod dashboards { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1497,47 +1380,25 @@ pub mod widgets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WidgetList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) + .get_str(&azure_core::http::headers::HeaderName::from_static("etag")) } } #[derive(Clone)] @@ -1579,26 +1440,30 @@ pub mod widgets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(e_tag) = &this.e_tag { req.insert_header("etag", e_tag); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", self.client.endpoint(), &self.organization, @@ -1608,10 +1473,12 @@ pub mod widgets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1636,37 +1503,15 @@ pub mod widgets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Widget = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1703,24 +1548,28 @@ pub mod widgets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", self.client.endpoint(), &self.organization, @@ -1730,10 +1579,12 @@ pub mod widgets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1758,47 +1609,25 @@ pub mod widgets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WidgetList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) + .get_str(&azure_core::http::headers::HeaderName::from_static("etag")) } } #[derive(Clone)] @@ -1841,27 +1670,31 @@ pub mod widgets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(e_tag) = &this.e_tag { req.insert_header("etag", e_tag); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", self.client.endpoint(), &self.organization, @@ -1871,10 +1704,12 @@ pub mod widgets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1899,47 +1734,25 @@ pub mod widgets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WidgetList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) + .get_str(&azure_core::http::headers::HeaderName::from_static("etag")) } } #[derive(Clone)] @@ -1982,27 +1795,31 @@ pub mod widgets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(e_tag) = &this.e_tag { req.insert_header("etag", e_tag); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", self.client.endpoint(), &self.organization, @@ -2012,10 +1829,12 @@ pub mod widgets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2040,37 +1859,15 @@ pub mod widgets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Widget = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2107,23 +1904,27 @@ pub mod widgets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", self.client.endpoint(), &self.organization, @@ -2134,10 +1935,12 @@ pub mod widgets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2162,37 +1965,15 @@ pub mod widgets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Widget = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2230,24 +2011,28 @@ pub mod widgets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", self.client.endpoint(), &self.organization, @@ -2258,10 +2043,12 @@ pub mod widgets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2286,37 +2073,15 @@ pub mod widgets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Widget = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2354,24 +2119,28 @@ pub mod widgets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", self.client.endpoint(), &self.organization, @@ -2382,10 +2151,12 @@ pub mod widgets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2410,37 +2181,15 @@ pub mod widgets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Dashboard = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2477,23 +2226,27 @@ pub mod widgets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", self.client.endpoint(), &self.organization, @@ -2504,10 +2257,12 @@ pub mod widgets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/dashboard/models.rs b/azure_devops_rust_api/src/dashboard/models.rs index bcc069e8..61765987 100644 --- a/azure_devops_rust_api/src/dashboard/models.rs +++ b/azure_devops_rust_api/src/dashboard/models.rs @@ -158,7 +158,7 @@ pub struct Dashboard { #[doc = "The set of Widgets on the dashboard."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub widgets: Vec, @@ -191,7 +191,7 @@ pub struct DashboardGroup { #[serde( rename = "dashboardEntries", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dashboard_entries: Vec, @@ -272,7 +272,7 @@ pub struct DashboardList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -396,7 +396,7 @@ pub struct Widget { #[serde( rename = "allowedSizes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub allowed_sizes: Vec, @@ -498,7 +498,7 @@ pub struct WidgetList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -515,7 +515,7 @@ pub struct WidgetMetadata { #[serde( rename = "allowedSizes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub allowed_sizes: Vec, @@ -605,7 +605,7 @@ pub struct WidgetMetadata { #[doc = "Keywords associated with this widget, non-filterable and invisible"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub keywords: Vec, @@ -637,21 +637,21 @@ pub struct WidgetMetadata { #[serde( rename = "supportedScopes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub supported_scopes: Vec, #[doc = "Tags associated with this widget, visible on each widget and filterable."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, #[doc = "Contribution target IDs"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub targets: Vec, @@ -732,7 +732,7 @@ pub struct WidgetTypesResponse { #[serde( rename = "widgetTypes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub widget_types: Vec, @@ -748,13 +748,13 @@ pub struct WidgetsVersionedList { #[serde( rename = "eTag", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub e_tag: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub widgets: Vec, diff --git a/azure_devops_rust_api/src/date_time.rs b/azure_devops_rust_api/src/date_time.rs index f9663e1d..7c83aae9 100644 --- a/azure_devops_rust_api/src/date_time.rs +++ b/azure_devops_rust_api/src/date_time.rs @@ -60,7 +60,7 @@ pub mod rfc3339 { match OffsetDateTime::parse(value, &Rfc3339) { Ok(dt) => Ok(dt), Err(e) => { - if let Ok(dt) = OffsetDateTime::parse(&format!("{}Z", value), &Rfc3339) { + if let Ok(dt) = OffsetDateTime::parse(&format!("{value}Z"), &Rfc3339) { Ok(dt) } else { Err(E::custom(format!("Parse error {e} for {value}"))) diff --git a/azure_devops_rust_api/src/distributed_task/mod.rs b/azure_devops_rust_api/src/distributed_task/mod.rs index 1891c39b..e67db86e 100644 --- a/azure_devops_rust_api/src/distributed_task/mod.rs +++ b/azure_devops_rust_api/src/distributed_task/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -234,23 +235,10 @@ pub mod events { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -287,24 +275,28 @@ pub mod events { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/events", self.client.endpoint(), &self.organization, @@ -314,10 +306,12 @@ pub mod events { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -379,38 +373,15 @@ pub mod oidctoken { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskHubOidcToken = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -456,29 +427,33 @@ pub mod oidctoken { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(service_connection_id) = &this.service_connection_id { req.url_mut() .query_pairs_mut() .append_pair("serviceConnectionId", service_connection_id); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/jobs/{}/oidctoken", self.client.endpoint(), &self.organization, @@ -489,10 +464,12 @@ pub mod oidctoken { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -580,37 +557,15 @@ pub mod logs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskLog = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -647,24 +602,28 @@ pub mod logs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/logs", self.client.endpoint(), &self.organization, @@ -674,10 +633,12 @@ pub mod logs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -702,37 +663,15 @@ pub mod logs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskLog = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -770,24 +709,28 @@ pub mod logs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/logs/{}", self.client.endpoint(), &self.organization, @@ -798,10 +741,12 @@ pub mod logs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -864,38 +809,15 @@ pub mod records { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TimelineRecordList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -933,24 +855,28 @@ pub mod records { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/timelines/{}/records", self.client.endpoint(), &self.organization, @@ -961,10 +887,12 @@ pub mod records { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1098,38 +1026,15 @@ pub mod pools { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentPoolList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1186,14 +1091,18 @@ pub mod pools { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(pool_name) = &this.pool_name { req.url_mut() @@ -1215,24 +1124,26 @@ pub mod pools { .query_pairs_mut() .append_pair("actionFilter", action_filter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/pools?", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1257,38 +1168,15 @@ pub mod pools { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentPoolList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1328,14 +1216,18 @@ pub mod pools { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let pool_ids = &this.pool_ids; req.url_mut() @@ -1346,24 +1238,26 @@ pub mod pools { .query_pairs_mut() .append_pair("actionFilter", action_filter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/pools", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1388,37 +1282,15 @@ pub mod pools { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentPool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1452,34 +1324,40 @@ pub mod pools { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/pools", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1504,37 +1382,15 @@ pub mod pools { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentPool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1580,14 +1436,18 @@ pub mod pools { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(properties) = &this.properties { req.url_mut() @@ -1599,14 +1459,14 @@ pub mod pools { .query_pairs_mut() .append_pair("actionFilter", action_filter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/pools/{}", self.client.endpoint(), &self.organization, @@ -1614,10 +1474,12 @@ pub mod pools { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1642,37 +1504,15 @@ pub mod pools { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentPool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1707,24 +1547,28 @@ pub mod pools { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/pools/{}", self.client.endpoint(), &self.organization, @@ -1732,10 +1576,12 @@ pub mod pools { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1760,23 +1606,10 @@ pub mod pools { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1810,23 +1643,27 @@ pub mod pools { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/pools/{}", self.client.endpoint(), &self.organization, @@ -1834,10 +1671,12 @@ pub mod pools { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2012,38 +1851,15 @@ pub mod queues { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentQueueList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2084,14 +1900,18 @@ pub mod queues { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let queue_names = &this.queue_names; req.url_mut() @@ -2102,14 +1922,14 @@ pub mod queues { .query_pairs_mut() .append_pair("actionFilter", action_filter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/queues?queueNames={}", self.client.endpoint(), &self.organization, @@ -2118,10 +1938,12 @@ pub mod queues { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2146,38 +1968,15 @@ pub mod queues { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentQueueList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2218,14 +2017,18 @@ pub mod queues { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let queue_ids = &this.queue_ids; req.url_mut() @@ -2236,14 +2039,14 @@ pub mod queues { .query_pairs_mut() .append_pair("actionFilter", action_filter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/queues?queueIds={}", self.client.endpoint(), &self.organization, @@ -2252,10 +2055,12 @@ pub mod queues { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2280,38 +2085,15 @@ pub mod queues { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentQueueList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2357,14 +2139,18 @@ pub mod queues { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(queue_name) = &this.queue_name { req.url_mut() @@ -2376,14 +2162,14 @@ pub mod queues { .query_pairs_mut() .append_pair("actionFilter", action_filter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/queues?", self.client.endpoint(), &self.organization, @@ -2391,10 +2177,12 @@ pub mod queues { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2419,38 +2207,15 @@ pub mod queues { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentQueueList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2491,14 +2256,18 @@ pub mod queues { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let pool_ids = &this.pool_ids; req.url_mut() @@ -2509,14 +2278,14 @@ pub mod queues { .query_pairs_mut() .append_pair("actionFilter", action_filter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/queues", self.client.endpoint(), &self.organization, @@ -2524,10 +2293,12 @@ pub mod queues { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2552,37 +2323,15 @@ pub mod queues { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentQueue = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2623,17 +2372,21 @@ pub mod queues { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(authorize_pipelines) = &this.authorize_pipelines { req.url_mut().query_pairs_mut().append_pair( "authorizePipelines", @@ -2641,12 +2394,12 @@ pub mod queues { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/queues", self.client.endpoint(), &self.organization, @@ -2654,10 +2407,12 @@ pub mod queues { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2682,37 +2437,15 @@ pub mod queues { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentQueue = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2753,28 +2486,32 @@ pub mod queues { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(action_filter) = &this.action_filter { req.url_mut() .query_pairs_mut() .append_pair("actionFilter", action_filter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/queues/{}", self.client.endpoint(), &self.organization, @@ -2783,10 +2520,12 @@ pub mod queues { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2811,23 +2550,10 @@ pub mod queues { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2862,23 +2588,27 @@ pub mod queues { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/queues/{}", self.client.endpoint(), &self.organization, @@ -2887,10 +2617,12 @@ pub mod queues { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3055,38 +2787,15 @@ pub mod variablegroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::VariableGroupList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3150,14 +2859,18 @@ pub mod variablegroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(group_name) = &this.group_name { req.url_mut() @@ -3184,14 +2897,14 @@ pub mod variablegroups { .query_pairs_mut() .append_pair("queryOrder", query_order); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/variablegroups?", self.client.endpoint(), &self.organization, @@ -3199,10 +2912,12 @@ pub mod variablegroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3227,37 +2942,15 @@ pub mod variablegroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::VariableGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3291,34 +2984,40 @@ pub mod variablegroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/variablegroups", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3343,23 +3042,10 @@ pub mod variablegroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3394,38 +3080,44 @@ pub mod variablegroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let variable_group_id = &this.variable_group_id; req.url_mut() .query_pairs_mut() .append_pair("variableGroupId", &variable_group_id.to_string()); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/variablegroups", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3453,37 +3145,15 @@ pub mod variablegroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::VariableGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3518,24 +3188,28 @@ pub mod variablegroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/variablegroups/{}", self.client.endpoint(), &self.organization, @@ -3543,10 +3217,12 @@ pub mod variablegroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3571,23 +3247,10 @@ pub mod variablegroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3622,27 +3285,31 @@ pub mod variablegroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let project_ids = &this.project_ids; req.url_mut() .query_pairs_mut() .append_pair("projectIds", project_ids); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/variablegroups/{}", self.client.endpoint(), &self.organization, @@ -3650,10 +3317,12 @@ pub mod variablegroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3681,38 +3350,15 @@ pub mod variablegroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::VariableGroupList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3747,27 +3393,31 @@ pub mod variablegroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let group_ids = &this.group_ids; req.url_mut() .query_pairs_mut() .append_pair("groupIds", group_ids); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/variablegroups", self.client.endpoint(), &self.organization, @@ -3775,10 +3425,12 @@ pub mod variablegroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3803,37 +3455,15 @@ pub mod variablegroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::VariableGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3868,23 +3498,27 @@ pub mod variablegroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/variablegroups/{}", self.client.endpoint(), &self.organization, @@ -3893,10 +3527,12 @@ pub mod variablegroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3993,38 +3629,15 @@ pub mod agentclouds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloudList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4057,33 +3670,39 @@ pub mod agentclouds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/agentclouds", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4108,37 +3727,15 @@ pub mod agentclouds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloud = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4172,34 +3769,40 @@ pub mod agentclouds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/agentclouds", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4224,37 +3827,15 @@ pub mod agentclouds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloud = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4288,23 +3869,27 @@ pub mod agentclouds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/agentclouds/{}", self.client.endpoint(), &self.organization, @@ -4312,10 +3897,12 @@ pub mod agentclouds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4340,37 +3927,15 @@ pub mod agentclouds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloud = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4405,24 +3970,28 @@ pub mod agentclouds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/agentclouds/{}", self.client.endpoint(), &self.organization, @@ -4430,10 +3999,12 @@ pub mod agentclouds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4458,37 +4029,15 @@ pub mod agentclouds { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloud = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4522,23 +4071,27 @@ pub mod agentclouds { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/agentclouds/{}", self.client.endpoint(), &self.organization, @@ -4546,10 +4099,12 @@ pub mod agentclouds { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4597,38 +4152,18 @@ pub mod requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TaskAgentCloudRequestList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloudRequestList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4662,23 +4197,27 @@ pub mod requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/agentclouds/{}/requests", self.client.endpoint(), &self.organization, @@ -4686,10 +4225,12 @@ pub mod requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4735,38 +4276,18 @@ pub mod agentcloudtypes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TaskAgentCloudTypeList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloudTypeList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4799,33 +4320,39 @@ pub mod agentcloudtypes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/agentcloudtypes", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4984,37 +4511,15 @@ pub mod agents { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5087,14 +4592,18 @@ pub mod agents { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(agent_name) = &this.agent_name { req.url_mut() @@ -5131,14 +4640,14 @@ pub mod agents { .query_pairs_mut() .append_pair("demands", demands); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/pools/{}/agents", self.client.endpoint(), &self.organization, @@ -5146,10 +4655,12 @@ pub mod agents { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5174,37 +4685,15 @@ pub mod agents { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgent = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5239,24 +4728,28 @@ pub mod agents { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/pools/{}/agents", self.client.endpoint(), &self.organization, @@ -5264,10 +4757,12 @@ pub mod agents { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5292,37 +4787,15 @@ pub mod agents { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgent = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5384,14 +4857,18 @@ pub mod agents { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_capabilities) = &this.include_capabilities { req.url_mut().query_pairs_mut().append_pair( @@ -5418,14 +4895,14 @@ pub mod agents { .query_pairs_mut() .append_pair("propertyFilters", property_filters); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/pools/{}/agents/{}", self.client.endpoint(), &self.organization, @@ -5434,10 +4911,12 @@ pub mod agents { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5462,37 +4941,15 @@ pub mod agents { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgent = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5528,24 +4985,28 @@ pub mod agents { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/pools/{}/agents/{}", self.client.endpoint(), &self.organization, @@ -5554,10 +5015,12 @@ pub mod agents { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5582,37 +5045,15 @@ pub mod agents { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgent = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5648,24 +5089,28 @@ pub mod agents { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/pools/{}/agents/{}", self.client.endpoint(), &self.organization, @@ -5674,10 +5119,12 @@ pub mod agents { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5702,23 +5149,10 @@ pub mod agents { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5753,23 +5187,27 @@ pub mod agents { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/pools/{}/agents/{}", self.client.endpoint(), &self.organization, @@ -5778,10 +5216,12 @@ pub mod agents { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5830,37 +5270,15 @@ pub mod yamlschema { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: serde_json::Value = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5899,38 +5317,44 @@ pub mod yamlschema { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(validate_task_names) = &this.validate_task_names { req.url_mut() .query_pairs_mut() .append_pair("validateTaskNames", &validate_task_names.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/yamlschema", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6068,38 +5492,15 @@ pub mod deploymentgroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentGroupList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6169,14 +5570,18 @@ pub mod deploymentgroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(name) = &this.name { req.url_mut().query_pairs_mut().append_pair("name", name); @@ -6204,14 +5609,14 @@ pub mod deploymentgroups { if let Some(ids) = &this.ids { req.url_mut().query_pairs_mut().append_pair("ids", ids); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/deploymentgroups", self.client.endpoint(), &self.organization, @@ -6219,10 +5624,12 @@ pub mod deploymentgroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6247,38 +5654,15 @@ pub mod deploymentgroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentGroup = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6313,24 +5697,28 @@ pub mod deploymentgroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/deploymentgroups", self.client.endpoint(), &self.organization, @@ -6338,10 +5726,12 @@ pub mod deploymentgroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6366,38 +5756,15 @@ pub mod deploymentgroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentGroup = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6444,14 +5811,18 @@ pub mod deploymentgroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(action_filter) = &this.action_filter { req.url_mut() @@ -6463,14 +5834,14 @@ pub mod deploymentgroups { .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", self.client.endpoint(), &self.organization, @@ -6479,10 +5850,12 @@ pub mod deploymentgroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6507,38 +5880,15 @@ pub mod deploymentgroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentGroup = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6574,24 +5924,28 @@ pub mod deploymentgroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", self.client.endpoint(), &self.organization, @@ -6600,10 +5954,12 @@ pub mod deploymentgroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6628,23 +5984,10 @@ pub mod deploymentgroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6679,23 +6022,27 @@ pub mod deploymentgroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", self.client.endpoint(), &self.organization, @@ -6704,10 +6051,12 @@ pub mod deploymentgroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6841,38 +6190,15 @@ pub mod targets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentMachineList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6966,14 +6292,18 @@ pub mod targets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(tags) = &this.tags { req.url_mut().query_pairs_mut().append_pair("tags", tags); @@ -7021,14 +6351,14 @@ pub mod targets { .query_pairs_mut() .append_pair("propertyFilters", property_filters); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets", self.client.endpoint(), &self.organization, @@ -7037,10 +6367,12 @@ pub mod targets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7065,38 +6397,15 @@ pub mod targets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentMachineList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7132,24 +6441,28 @@ pub mod targets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets", self.client.endpoint(), &self.organization, @@ -7158,10 +6471,12 @@ pub mod targets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7186,38 +6501,15 @@ pub mod targets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentMachine = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7259,28 +6551,32 @@ pub mod targets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets/{}", self.client.endpoint(), &self.organization, @@ -7290,10 +6586,12 @@ pub mod targets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7318,23 +6616,10 @@ pub mod targets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7370,23 +6655,27 @@ pub mod targets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets/{}", self.client.endpoint(), &self.organization, @@ -7396,10 +6685,12 @@ pub mod targets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7536,38 +6827,18 @@ pub mod environments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::EnvironmentInstanceList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentInstanceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7616,14 +6887,18 @@ pub mod environments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(name) = &this.name { req.url_mut().query_pairs_mut().append_pair("name", name); @@ -7638,14 +6913,14 @@ pub mod environments { .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/environments", self.client.endpoint(), &self.organization, @@ -7653,10 +6928,12 @@ pub mod environments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7682,38 +6959,15 @@ pub mod environments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentInstance = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7748,24 +7002,28 @@ pub mod environments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/environments", self.client.endpoint(), &self.organization, @@ -7773,10 +7031,12 @@ pub mod environments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7801,38 +7061,15 @@ pub mod environments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentInstance = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7873,28 +7110,32 @@ pub mod environments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expands) = &this.expands { req.url_mut() .query_pairs_mut() .append_pair("expands", expands); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/environments/{}", self.client.endpoint(), &self.organization, @@ -7903,10 +7144,12 @@ pub mod environments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7931,38 +7174,15 @@ pub mod environments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentInstance = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7998,24 +7218,28 @@ pub mod environments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/environments/{}", self.client.endpoint(), &self.organization, @@ -8024,10 +7248,12 @@ pub mod environments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8052,23 +7278,10 @@ pub mod environments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8103,23 +7316,27 @@ pub mod environments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/environments/{}", self.client.endpoint(), &self.organization, @@ -8128,10 +7345,12 @@ pub mod environments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8189,40 +7408,20 @@ pub mod environmentdeployment_records { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::EnvironmentDeploymentExecutionRecordList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentDeploymentExecutionRecordList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8267,14 +7466,18 @@ pub mod environmentdeployment_records { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(continuation_token) = &this.continuation_token { req.url_mut() @@ -8286,14 +7489,14 @@ pub mod environmentdeployment_records { .query_pairs_mut() .append_pair("top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/environments/{}/environmentdeploymentrecords", self.client.endpoint(), &self.organization, @@ -8302,10 +7505,12 @@ pub mod environmentdeployment_records { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8397,38 +7602,15 @@ pub mod kubernetes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::KubernetesResource = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8464,24 +7646,28 @@ pub mod kubernetes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes", self.client.endpoint(), &self.organization, @@ -8490,10 +7676,12 @@ pub mod kubernetes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8518,38 +7706,15 @@ pub mod kubernetes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::KubernetesResource = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8585,23 +7750,27 @@ pub mod kubernetes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes/{}", self.client.endpoint(), &self.organization, @@ -8611,10 +7780,12 @@ pub mod kubernetes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8639,23 +7810,10 @@ pub mod kubernetes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8691,23 +7849,27 @@ pub mod kubernetes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes/{}", self.client.endpoint(), &self.organization, @@ -8717,10 +7879,12 @@ pub mod kubernetes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8844,37 +8008,15 @@ pub mod taskgroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8909,24 +8051,28 @@ pub mod taskgroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/taskgroups", self.client.endpoint(), &self.organization, @@ -8934,10 +8080,12 @@ pub mod taskgroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8962,37 +8110,15 @@ pub mod taskgroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskGroupList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9066,14 +8192,18 @@ pub mod taskgroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expanded) = &this.expanded { req.url_mut() @@ -9096,23 +8226,25 @@ pub mod taskgroups { .append_pair("$top", &top.to_string()); } if let Some(continuation_token) = &this.continuation_token { + let formatted_date_time = + crate::date_time::format_date_time(continuation_token)?; req.url_mut() .query_pairs_mut() - .append_pair("continuationToken", &continuation_token.to_string()); + .append_pair("continuationToken", &formatted_date_time); } if let Some(query_order) = &this.query_order { req.url_mut() .query_pairs_mut() .append_pair("queryOrder", query_order); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/taskgroups/{}", self.client.endpoint(), &self.organization, @@ -9121,10 +8253,12 @@ pub mod taskgroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9149,37 +8283,15 @@ pub mod taskgroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9215,24 +8327,28 @@ pub mod taskgroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/taskgroups/{}", self.client.endpoint(), &self.organization, @@ -9241,10 +8357,12 @@ pub mod taskgroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9269,23 +8387,10 @@ pub mod taskgroups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9326,28 +8431,32 @@ pub mod taskgroups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(comment) = &this.comment { req.url_mut() .query_pairs_mut() .append_pair("comment", comment); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/distributedtask/taskgroups/{}", self.client.endpoint(), &self.organization, @@ -9356,10 +8465,12 @@ pub mod taskgroups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9459,38 +8570,15 @@ pub mod elasticpools { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticPoolList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9523,33 +8611,39 @@ pub mod elasticpools { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/elasticpools", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9574,38 +8668,18 @@ pub mod elasticpools { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ElasticPoolCreationResult, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticPoolCreationResult = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9661,17 +8735,21 @@ pub mod elasticpools { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let pool_name = &this.pool_name; req.url_mut() .query_pairs_mut() @@ -9696,22 +8774,24 @@ pub mod elasticpools { .append_pair("projectId", project_id); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/elasticpools", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9737,37 +8817,15 @@ pub mod elasticpools { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticPool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9801,23 +8859,27 @@ pub mod elasticpools { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/elasticpools/{}", self.client.endpoint(), &self.organization, @@ -9825,10 +8887,12 @@ pub mod elasticpools { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9853,37 +8917,15 @@ pub mod elasticpools { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticPool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9918,24 +8960,28 @@ pub mod elasticpools { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/elasticpools/{}", self.client.endpoint(), &self.organization, @@ -9943,10 +8989,12 @@ pub mod elasticpools { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9994,38 +9042,15 @@ pub mod elasticpoollogs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticPoolLogList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10065,28 +9090,32 @@ pub mod elasticpoollogs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/elasticpools/{}/logs", self.client.endpoint(), &self.organization, @@ -10094,10 +9123,12 @@ pub mod elasticpoollogs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10164,38 +9195,15 @@ pub mod nodes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticNodeList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10235,26 +9243,30 @@ pub mod nodes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(state) = &this.state { req.url_mut().query_pairs_mut().append_pair("$state", state); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/elasticpools/{}/nodes", self.client.endpoint(), &self.organization, @@ -10262,10 +9274,12 @@ pub mod nodes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10290,37 +9304,15 @@ pub mod nodes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticNode = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10356,24 +9348,28 @@ pub mod nodes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/distributedtask/elasticpools/{}/nodes/{}", self.client.endpoint(), &self.organization, @@ -10382,10 +9378,12 @@ pub mod nodes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/distributed_task/models.rs b/azure_devops_rust_api/src/distributed_task/models.rs index 9bb05776..d6540478 100644 --- a/azure_devops_rust_api/src/distributed_task/models.rs +++ b/azure_devops_rust_api/src/distributed_task/models.rs @@ -73,7 +73,7 @@ pub struct AgentJobRequestMessage { pub request_id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tasks: Vec, @@ -115,7 +115,7 @@ pub struct AgentQueuesEvent { pub event_type: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub queues: Vec, @@ -266,7 +266,7 @@ pub struct AzureManagementGroupQueryResult { #[doc = "List of azure management groups"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -382,7 +382,7 @@ pub struct AzureSubscriptionQueryResult { pub error_message: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -433,7 +433,7 @@ pub struct DataSource { pub endpoint_url: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub headers: Vec, @@ -508,7 +508,7 @@ pub struct DataSourceBindingBase { #[doc = "Gets or sets the authorization headers."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub headers: Vec, @@ -575,7 +575,7 @@ pub struct DataSourceDetails { pub data_source_url: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub headers: Vec, @@ -697,7 +697,7 @@ pub struct DependencyData { pub input: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub map: Vec, @@ -713,7 +713,7 @@ pub struct DependsOn { pub input: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub map: Vec, @@ -728,7 +728,7 @@ pub struct DeploymentGatesChangeEvent { #[serde( rename = "gateNames", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub gate_names: Vec, @@ -756,7 +756,7 @@ pub struct DeploymentGroup { #[doc = "List of deployment targets in the deployment group."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub machines: Vec, @@ -764,7 +764,7 @@ pub struct DeploymentGroup { #[serde( rename = "machineTags", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub machine_tags: Vec, @@ -810,7 +810,7 @@ pub struct DeploymentGroupList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -840,7 +840,7 @@ pub struct DeploymentGroupMetrics { #[doc = "Values of properties and the metrics. E.g. 1: total count of deployment targets for which 'TargetState' is 'offline'. E.g. 2: Average time of deployment to the deployment targets for which 'LastJobStatus' is 'passed' and 'TargetState' is 'online'."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub rows: Vec, @@ -899,7 +899,7 @@ pub struct DeploymentMachine { #[doc = "Tags of the deployment target."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -916,14 +916,14 @@ pub struct DeploymentMachineChangedData { #[serde( rename = "addedTags", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub added_tags: Vec, #[serde( rename = "deletedTags", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub deleted_tags: Vec, @@ -939,7 +939,7 @@ pub struct DeploymentMachineGroup { pub deployment_machine_group_reference: DeploymentMachineGroupReference, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub machines: Vec, @@ -973,7 +973,7 @@ pub struct DeploymentMachineList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -994,7 +994,7 @@ pub struct DeploymentMachinesChangeEvent { pub machine_group_reference: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub machines: Vec, @@ -1011,7 +1011,7 @@ pub struct DeploymentPoolSummary { #[serde( rename = "deploymentGroups", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub deployment_groups: Vec, @@ -1048,7 +1048,7 @@ pub struct DeploymentTargetUpdateParameter { pub id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -1306,7 +1306,7 @@ pub struct ElasticNodeList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1548,7 +1548,7 @@ pub struct ElasticPoolList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1622,7 +1622,7 @@ pub struct ElasticPoolLogList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1910,7 +1910,7 @@ pub struct EnvironmentDeploymentExecutionRecordList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1960,7 +1960,7 @@ pub struct EnvironmentInstance { pub project: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub resources: Vec, @@ -1976,7 +1976,7 @@ pub struct EnvironmentInstanceList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2050,7 +2050,7 @@ pub struct EnvironmentResource { #[doc = "Tags of the Environment Resource."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -2154,7 +2154,7 @@ pub struct EnvironmentResourceReference { #[doc = "Tags of the Environment Resource Reference."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -2327,7 +2327,7 @@ pub struct InputDescriptor { #[serde( rename = "dependencyInputIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dependency_input_ids: Vec, @@ -2554,7 +2554,7 @@ pub struct InputValues { #[serde( rename = "possibleValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub possible_values: Vec, @@ -2749,13 +2749,13 @@ pub mod job_completed_event { pub struct JobEnvironment { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub endpoints: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mask: Vec, @@ -2764,7 +2764,7 @@ pub struct JobEnvironment { #[serde( rename = "secureFiles", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub secure_files: Vec, @@ -2961,7 +2961,7 @@ pub struct KubernetesResourceCreateParameters { #[doc = "Tags of the kubernetes resource."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -3108,14 +3108,14 @@ pub struct MetricsColumnsHeader { #[doc = "Properties of deployment group for which metrics are provided. E.g. 1: LastJobStatus E.g. 2: TargetState"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dimensions: Vec, #[doc = "The types of metrics. E.g. 1: total count of deployment targets. E.g. 2: Average time of deployment to the deployment targets."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub metrics: Vec, @@ -3131,14 +3131,14 @@ pub struct MetricsRow { #[doc = "The values of the properties mentioned as 'Dimensions' in column header. E.g. 1: For a property 'LastJobStatus' - metrics will be provided for 'passed', 'failed', etc. E.g. 2: For a property 'TargetState' - metrics will be provided for 'online', 'offline' targets."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dimensions: Vec, #[doc = "Metrics in serialized format. Should be deserialized based on the data type provided in header."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub metrics: Vec, @@ -3207,7 +3207,7 @@ impl PackageVersion { pub struct PlanEnvironment { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mask: Vec, @@ -3244,14 +3244,14 @@ pub struct PropertiesCollection { #[doc = "The set of keys in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub keys: Vec, #[doc = "The set of values in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -3307,14 +3307,14 @@ impl ReferenceLinks { pub struct ResourceFilterOptions { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub identities: Vec, #[serde( rename = "resourceTypes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub resource_types: Vec, @@ -3329,14 +3329,14 @@ pub struct ResourceFilters { #[serde( rename = "createdBy", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub created_by: Vec, #[serde( rename = "resourceType", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub resource_type: Vec, @@ -3558,7 +3558,7 @@ pub struct ResourceUsage { #[serde( rename = "runningRequests", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub running_requests: Vec, @@ -3605,7 +3605,7 @@ pub struct ResourcesHubData { #[serde( rename = "resourceItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub resource_items: Vec, @@ -3676,7 +3676,7 @@ pub struct SecureFileEvent { #[serde( rename = "secureFiles", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub secure_files: Vec, @@ -3806,7 +3806,7 @@ pub struct ServiceEndpointAuthenticationScheme { #[serde( rename = "authorizationHeaders", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub authorization_headers: Vec, @@ -3814,7 +3814,7 @@ pub struct ServiceEndpointAuthenticationScheme { #[serde( rename = "clientCertificates", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub client_certificates: Vec, @@ -3829,7 +3829,7 @@ pub struct ServiceEndpointAuthenticationScheme { #[serde( rename = "inputDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_descriptors: Vec, @@ -3941,7 +3941,7 @@ pub struct ServiceEndpointExecutionRecordsInput { #[serde( rename = "endpointIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub endpoint_ids: Vec, @@ -4107,7 +4107,7 @@ pub struct ServiceEndpointType { #[serde( rename = "authenticationSchemes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub authentication_schemes: Vec, @@ -4115,7 +4115,7 @@ pub struct ServiceEndpointType { #[serde( rename = "dataSources", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub data_sources: Vec, @@ -4123,7 +4123,7 @@ pub struct ServiceEndpointType { #[serde( rename = "dependencyData", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dependency_data: Vec, @@ -4159,7 +4159,7 @@ pub struct ServiceEndpointType { #[serde( rename = "inputDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_descriptors: Vec, @@ -4170,7 +4170,7 @@ pub struct ServiceEndpointType { #[serde( rename = "trustedHosts", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub trusted_hosts: Vec, @@ -4369,7 +4369,7 @@ pub struct TaskAgentCloudList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4442,7 +4442,7 @@ pub struct TaskAgentCloudRequestList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4465,7 +4465,7 @@ pub struct TaskAgentCloudType { #[serde( rename = "inputDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_descriptors: Vec, @@ -4484,7 +4484,7 @@ pub struct TaskAgentCloudTypeList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4520,13 +4520,13 @@ pub struct TaskAgentJob { pub sidecar_containers: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub steps: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub variables: Vec, @@ -4561,7 +4561,7 @@ pub struct TaskAgentJobRequest { #[doc = "A list of demands required to fulfill this request."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub demands: Vec, @@ -4593,7 +4593,7 @@ pub struct TaskAgentJobRequest { #[serde( rename = "matchedAgents", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub matched_agents: Vec, @@ -4789,7 +4789,7 @@ pub struct TaskAgentList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4818,7 +4818,7 @@ pub struct TaskAgentMessage { #[doc = "Gets or sets the initialization vector used to encrypt this message."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub iv: Vec, @@ -4925,7 +4925,7 @@ pub struct TaskAgentPoolList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -5053,7 +5053,7 @@ pub struct TaskAgentPoolMaintenanceJob { #[serde( rename = "targetAgents", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub target_agents: Vec, @@ -5328,7 +5328,7 @@ pub struct TaskAgentPoolSummary { #[serde( rename = "deploymentGroups", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub deployment_groups: Vec, @@ -5336,13 +5336,13 @@ pub struct TaskAgentPoolSummary { pub pool: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub queues: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub rows: Vec, @@ -5358,14 +5358,14 @@ pub struct TaskAgentPublicKey { #[doc = "Gets or sets the exponent for the public key."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub exponent: Vec, #[doc = "Gets or sets the modulus for the public key."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub modulus: Vec, @@ -5401,7 +5401,7 @@ pub struct TaskAgentQueueList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -5510,7 +5510,7 @@ pub struct TaskAgentSessionKey { #[doc = "Gets or sets the symmetric key value."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -5731,7 +5731,7 @@ pub struct TaskDefinition { #[serde( rename = "dataSourceBindings", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub data_source_bindings: Vec, @@ -5743,7 +5743,7 @@ pub struct TaskDefinition { pub definition_type: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub demands: Vec, @@ -5763,7 +5763,7 @@ pub struct TaskDefinition { pub friendly_name: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub groups: Vec, @@ -5783,7 +5783,7 @@ pub struct TaskDefinition { pub id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub inputs: Vec, @@ -5804,7 +5804,7 @@ pub struct TaskDefinition { #[serde( rename = "outputVariables", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub output_variables: Vec, @@ -5845,13 +5845,13 @@ pub struct TaskDefinition { #[serde( rename = "runsOn", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub runs_on: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub satisfies: Vec, @@ -5870,7 +5870,7 @@ pub struct TaskDefinition { #[serde( rename = "sourceDefinitions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub source_definitions: Vec, @@ -5884,7 +5884,7 @@ pub struct TaskDefinition { pub version: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub visibility: Vec, @@ -6034,7 +6034,7 @@ pub struct TaskGroup { #[doc = "Gets or sets the tasks."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tasks: Vec, @@ -6068,7 +6068,7 @@ pub struct TaskGroupCreateParameter { #[doc = "Sets input for the task group."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub inputs: Vec, @@ -6093,14 +6093,14 @@ pub struct TaskGroupCreateParameter { #[serde( rename = "runsOn", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub runs_on: Vec, #[doc = "Sets tasks for the task group."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tasks: Vec, @@ -6130,7 +6130,7 @@ pub struct TaskGroupDefinition { pub name: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -6152,7 +6152,7 @@ pub struct TaskGroupList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -6339,7 +6339,7 @@ pub struct TaskGroupUpdateParameter { #[doc = "Sets input for the task group."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub inputs: Vec, @@ -6367,14 +6367,14 @@ pub struct TaskGroupUpdateParameter { #[serde( rename = "runsOn", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub runs_on: Vec, #[doc = "Sets tasks for the task group."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tasks: Vec, @@ -6515,7 +6515,7 @@ impl TaskInputDefinition { pub struct TaskInputDefinitionBase { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub aliases: Vec, @@ -6684,7 +6684,7 @@ pub struct TaskOrchestrationContainer { pub task_orchestration_item: TaskOrchestrationItem, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub children: Vec, @@ -6738,7 +6738,7 @@ pub struct TaskOrchestrationJob { pub task_orchestration_item: TaskOrchestrationItem, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub demands: Vec, @@ -6768,7 +6768,7 @@ pub struct TaskOrchestrationJob { pub ref_name: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tasks: Vec, @@ -6900,7 +6900,7 @@ pub struct TaskOrchestrationPlanGroup { #[serde( rename = "runningRequests", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub running_requests: Vec, @@ -7026,7 +7026,7 @@ pub struct TaskOrchestrationQueuedPlanGroup { pub plan_group: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub plans: Vec, @@ -7156,7 +7156,7 @@ impl TaskStartedEvent { pub struct TaskVariableRestrictions { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub allowed: Vec, @@ -7201,7 +7201,7 @@ pub struct Timeline { pub last_changed_on: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub records: Vec, @@ -7286,7 +7286,7 @@ pub struct TimelineRecord { #[doc = "The list of issues produced by this operation."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub issues: Vec, @@ -7324,7 +7324,7 @@ pub struct TimelineRecord { #[serde( rename = "previousAttempts", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub previous_attempts: Vec, @@ -7425,7 +7425,7 @@ pub struct TimelineRecordFeedLinesWrapper { pub step_id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -7441,7 +7441,7 @@ pub struct TimelineRecordList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -7542,7 +7542,7 @@ pub struct VariableGroup { #[serde( rename = "variableGroupProjectReferences", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub variable_group_project_references: Vec, @@ -7561,7 +7561,7 @@ pub struct VariableGroupList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -7592,7 +7592,7 @@ pub struct VariableGroupParameters { #[serde( rename = "variableGroupProjectReferences", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub variable_group_project_references: Vec, @@ -7665,7 +7665,7 @@ pub struct VirtualMachine { pub id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, diff --git a/azure_devops_rust_api/src/extension_management/mod.rs b/azure_devops_rust_api/src/extension_management/mod.rs index 4e946b08..baa29e5b 100644 --- a/azure_devops_rust_api/src/extension_management/mod.rs +++ b/azure_devops_rust_api/src/extension_management/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://extmgmt.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -240,38 +241,18 @@ pub mod installed_extensions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::InstalledExtensionList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::InstalledExtensionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -333,14 +314,18 @@ pub mod installed_extensions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_disabled_extensions) = &this.include_disabled_extensions { @@ -366,24 +351,26 @@ pub mod installed_extensions { &include_installation_issues.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/extensionmanagement/installedextensions", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -409,38 +396,15 @@ pub mod installed_extensions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::InstalledExtension = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -474,34 +438,40 @@ pub mod installed_extensions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/extensionmanagement/installedextensions", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -526,38 +496,15 @@ pub mod installed_extensions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::InstalledExtension = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -598,28 +545,32 @@ pub mod installed_extensions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(asset_types) = &this.asset_types { req.url_mut() .query_pairs_mut() .append_pair("assetTypes", asset_types); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}", self.client.endpoint(), &self.organization, @@ -628,10 +579,12 @@ pub mod installed_extensions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -656,23 +609,10 @@ pub mod installed_extensions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -717,14 +657,18 @@ pub mod installed_extensions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(reason) = &this.reason { req.url_mut() @@ -736,14 +680,14 @@ pub mod installed_extensions { .query_pairs_mut() .append_pair("reasonCode", reason_code); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}", self.client.endpoint(), &self.organization, @@ -752,10 +696,12 @@ pub mod installed_extensions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -783,38 +729,15 @@ pub mod installed_extensions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::InstalledExtension = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -850,24 +773,28 @@ pub mod installed_extensions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}/{}", self.client.endpoint(), &self.organization, @@ -877,10 +804,12 @@ pub mod installed_extensions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/extension_management/models.rs b/azure_devops_rust_api/src/extension_management/models.rs index 68577a2c..590eac45 100644 --- a/azure_devops_rust_api/src/extension_management/models.rs +++ b/azure_devops_rust_api/src/extension_management/models.rs @@ -27,7 +27,7 @@ pub struct AcquisitionOperation { #[doc = "List of reasons indicating why the operation is not allowed."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub reasons: Vec, @@ -97,7 +97,7 @@ pub struct AcquisitionOptions { #[doc = "Operations allowed for the ItemId in this target"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub operations: Vec, @@ -125,7 +125,7 @@ pub struct ClientContribution { #[doc = "Includes is a set of contributions that should have this contribution included in their targets list."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub includes: Vec, @@ -135,7 +135,7 @@ pub struct ClientContribution { #[doc = "The ids of the contribution(s) that this contribution targets. (parent contributions)"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub targets: Vec, @@ -154,7 +154,7 @@ pub struct ClientContributionNode { #[doc = "List of ids for contributions which are children to the current contribution."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub children: Vec, @@ -164,7 +164,7 @@ pub struct ClientContributionNode { #[doc = "List of ids for contributions which are parents to the current contribution."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub parents: Vec, @@ -224,14 +224,14 @@ pub struct Contribution { #[doc = "List of constraints (filters) that should be applied to the availability of this contribution"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub constraints: Vec, #[doc = "Includes is a set of contributions that should have this contribution included in their targets list."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub includes: Vec, @@ -242,14 +242,14 @@ pub struct Contribution { #[serde( rename = "restrictedTo", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub restricted_to: Vec, #[doc = "The ids of the contribution(s) that this contribution targets. (parent contributions)"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub targets: Vec, @@ -275,7 +275,7 @@ pub struct ContributionBase { #[serde( rename = "visibleTo", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub visible_to: Vec, @@ -306,7 +306,7 @@ pub struct ContributionConstraint { #[doc = "Constraints can be optionally be applied to one or more of the relationships defined in the contribution. If no relationships are defined then all relationships are associated with the constraint. This means the default behaviour will eliminate the contribution from the tree completely if the constraint is applied."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub relationships: Vec, @@ -323,7 +323,7 @@ pub struct ContributionNodeQuery { #[serde( rename = "contributionIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub contribution_ids: Vec, @@ -533,7 +533,7 @@ pub struct DataProviderQuery { #[serde( rename = "contributionIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub contribution_ids: Vec, @@ -563,7 +563,7 @@ pub struct DataProviderResult { #[serde( rename = "resolvedProviders", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub resolved_providers: Vec, @@ -670,7 +670,7 @@ pub struct ExtensionAuditLog { #[doc = "Collection of audit log entries"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub entries: Vec, @@ -729,7 +729,7 @@ pub struct ExtensionAuthorization { pub id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub scopes: Vec, @@ -766,7 +766,7 @@ pub struct ExtensionDataCollection { #[doc = "A list of documents belonging to the collection"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub documents: Vec, @@ -792,7 +792,7 @@ pub struct ExtensionDataCollectionQuery { #[doc = "A list of collections to query"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub collections: Vec, @@ -999,7 +999,7 @@ pub struct ExtensionLicensing { #[doc = "A list of contributions which deviate from the default licensing behavior"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub overrides: Vec, @@ -1018,14 +1018,14 @@ pub struct ExtensionManifest { #[doc = "List of shared constraints defined by this extension"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub constraints: Vec, #[doc = "List of contributions made by this extension"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub contributions: Vec, @@ -1033,14 +1033,14 @@ pub struct ExtensionManifest { #[serde( rename = "contributionTypes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub contribution_types: Vec, #[doc = "List of explicit demands required by this extension"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub demands: Vec, @@ -1075,14 +1075,14 @@ pub struct ExtensionManifest { #[serde( rename = "restrictedTo", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub restricted_to: Vec, #[doc = "List of all oauth scopes required by this extension"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub scopes: Vec, @@ -1294,7 +1294,7 @@ pub struct ExtensionRequestsEvent { #[doc = "The extension request object"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub requests: Vec, @@ -1419,7 +1419,7 @@ pub struct ExtensionVersion { pub asset_uri: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub badges: Vec, @@ -1431,7 +1431,7 @@ pub struct ExtensionVersion { pub fallback_asset_uri: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub files: Vec, @@ -1446,7 +1446,7 @@ pub struct ExtensionVersion { pub last_updated: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub properties: Vec, @@ -1615,7 +1615,7 @@ pub struct InstalledExtension { #[doc = "This is the set of files available from the extension."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub files: Vec, @@ -1673,7 +1673,7 @@ pub struct InstalledExtensionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1688,13 +1688,13 @@ pub struct InstalledExtensionQuery { #[serde( rename = "assetTypes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub asset_types: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub monikers: Vec, @@ -1714,7 +1714,7 @@ pub struct InstalledExtensionState { #[serde( rename = "installationIssues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub installation_issues: Vec, @@ -1807,7 +1807,7 @@ pub mod licensing_override { pub struct PublishedExtension { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub categories: Vec, @@ -1840,7 +1840,7 @@ pub struct PublishedExtension { #[serde( rename = "installationTargets", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub installation_targets: Vec, @@ -1886,7 +1886,7 @@ pub struct PublishedExtension { #[serde( rename = "sharedWith", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub shared_with: Vec, @@ -1898,19 +1898,19 @@ pub struct PublishedExtension { pub short_description: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub statistics: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub versions: Vec, @@ -1997,7 +1997,7 @@ pub struct RequestedExtension { #[serde( rename = "extensionRequests", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub extension_requests: Vec, diff --git a/azure_devops_rust_api/src/favorite/mod.rs b/azure_devops_rust_api/src/favorite/mod.rs index d3b75273..924761ad 100644 --- a/azure_devops_rust_api/src/favorite/mod.rs +++ b/azure_devops_rust_api/src/favorite/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -314,37 +315,15 @@ pub mod favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FavoriteList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -399,14 +378,18 @@ pub mod favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let owner_scope_type = &this.owner_scope_type; req.url_mut() @@ -437,14 +420,14 @@ pub mod favorites { &include_extended_details.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/favorite/favorites?ownerScopeType={}&ownerScopeId={}", self.client.endpoint(), &self.organization, @@ -453,10 +436,12 @@ pub mod favorites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -481,37 +466,15 @@ pub mod favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -547,17 +510,21 @@ pub mod favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let owner_scope_type = &this.owner_scope_type; req.url_mut() .query_pairs_mut() @@ -567,12 +534,12 @@ pub mod favorites { .query_pairs_mut() .append_pair("ownerScopeId", owner_scope_id); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/favorite/favorites?ownerScopeType={}&ownerScopeId={}", self.client.endpoint(), &self.organization, @@ -581,10 +548,12 @@ pub mod favorites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -609,37 +578,15 @@ pub mod favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -685,14 +632,18 @@ pub mod favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let artifact_type = &this.artifact_type; req.url_mut() @@ -717,20 +668,22 @@ pub mod favorites { &include_extended_details.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/favorite/favorites?artifactType={}&artifactId={}&artifactScopeType={}" , self . client . endpoint () , & self . organization , & self . artifact_type , & self . artifact_id , & self . artifact_scope_type)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/favorite/favorites?artifactType={}&artifactId={}&artifactScopeType={}" , self . client . endpoint () , & self . organization , & self . artifact_type , & self . artifact_id , & self . artifact_scope_type)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -755,23 +708,10 @@ pub mod favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -814,14 +754,18 @@ pub mod favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let owner_scope_type = &this.owner_scope_type; req.url_mut() @@ -844,20 +788,22 @@ pub mod favorites { .query_pairs_mut() .append_pair("artifactScopeId", artifact_scope_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/favorite/favorites/{}?ownerScopeType={}&ownerScopeId={}&artifactType={}&artifactScopeType={}" , self . client . endpoint () , & self . organization , & self . favorite_id , & self . owner_scope_type , & self . owner_scope_id , & self . artifact_type , & self . artifact_scope_type)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/favorite/favorites/{}?ownerScopeType={}&ownerScopeId={}&artifactType={}&artifactScopeType={}" , self . client . endpoint () , & self . organization , & self . favorite_id , & self . owner_scope_type , & self . owner_scope_id , & self . artifact_type , & self . artifact_scope_type)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -885,37 +831,15 @@ pub mod favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -963,14 +887,18 @@ pub mod favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let owner_scope_type = &this.owner_scope_type; req.url_mut() @@ -999,20 +927,22 @@ pub mod favorites { &include_extended_details.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/favorite/favorites/{}?ownerScopeType={}&ownerScopeId={}&artifactScopeType={}&artifactType={}" , self . client . endpoint () , & self . organization , & self . favorite_id , & self . owner_scope_type , & self . owner_scope_id , & self . artifact_scope_type , & self . artifact_type)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/favorite/favorites/{}?ownerScopeType={}&ownerScopeId={}&artifactScopeType={}&artifactType={}" , self . client . endpoint () , & self . organization , & self . favorite_id , & self . owner_scope_type , & self . owner_scope_id , & self . artifact_scope_type , & self . artifact_type)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1037,37 +967,15 @@ pub mod favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FavoriteList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1120,14 +1028,18 @@ pub mod favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(artifact_type) = &this.artifact_type { req.url_mut() @@ -1150,24 +1062,26 @@ pub mod favorites { &include_extended_details.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/favorite/favorites", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1192,37 +1106,15 @@ pub mod favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1256,34 +1148,40 @@ pub mod favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/favorite/favorites", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1308,37 +1206,15 @@ pub mod favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1384,14 +1260,18 @@ pub mod favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let artifact_scope_type = &this.artifact_scope_type; req.url_mut() @@ -1412,14 +1292,14 @@ pub mod favorites { &include_extended_details.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/favorite/favorites/{}", self.client.endpoint(), &self.organization, @@ -1427,10 +1307,12 @@ pub mod favorites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1455,23 +1337,10 @@ pub mod favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1512,14 +1381,18 @@ pub mod favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let artifact_type = &this.artifact_type; req.url_mut() @@ -1534,14 +1407,14 @@ pub mod favorites { .query_pairs_mut() .append_pair("artifactScopeId", artifact_scope_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/favorite/favorites/{}", self.client.endpoint(), &self.organization, @@ -1549,10 +1422,12 @@ pub mod favorites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/favorite/models.rs b/azure_devops_rust_api/src/favorite/models.rs index df4d521f..70acd6a7 100644 --- a/azure_devops_rust_api/src/favorite/models.rs +++ b/azure_devops_rust_api/src/favorite/models.rs @@ -144,7 +144,7 @@ pub struct FavoriteList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/git/mod.rs b/azure_devops_rust_api/src/git/mod.rs index d6f62246..6ee24ea7 100644 --- a/azure_devops_rust_api/src/git/mod.rs +++ b/azure_devops_rust_api/src/git/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -449,37 +450,15 @@ pub mod repositories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -515,27 +494,31 @@ pub mod repositories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let include_parent = &this.include_parent; req.url_mut() .query_pairs_mut() .append_pair("includeParent", &include_parent.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}?includeParent={}", self.client.endpoint(), &self.organization, @@ -545,10 +528,12 @@ pub mod repositories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -573,38 +558,18 @@ pub mod repositories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitDeletedRepositoryList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitDeletedRepositoryList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -638,23 +603,27 @@ pub mod repositories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/deletedrepositories", self.client.endpoint(), &self.organization, @@ -662,10 +631,12 @@ pub mod repositories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -691,38 +662,18 @@ pub mod repositories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitDeletedRepositoryList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitDeletedRepositoryList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -756,23 +707,27 @@ pub mod repositories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/recycleBin/repositories", self.client.endpoint(), &self.organization, @@ -780,10 +735,12 @@ pub mod repositories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -809,37 +766,15 @@ pub mod repositories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -875,24 +810,28 @@ pub mod repositories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/recycleBin/repositories/{}", self.client.endpoint(), &self.organization, @@ -901,10 +840,12 @@ pub mod repositories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -929,23 +870,10 @@ pub mod repositories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -980,23 +908,27 @@ pub mod repositories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/recycleBin/repositories/{}", self.client.endpoint(), &self.organization, @@ -1005,10 +937,12 @@ pub mod repositories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1036,38 +970,15 @@ pub mod repositories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepositoryList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1119,14 +1030,18 @@ pub mod repositories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_links) = &this.include_links { req.url_mut() @@ -1143,14 +1058,14 @@ pub mod repositories { .query_pairs_mut() .append_pair("includeHidden", &include_hidden.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories", self.client.endpoint(), &self.organization, @@ -1158,10 +1073,12 @@ pub mod repositories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1186,37 +1103,15 @@ pub mod repositories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1257,29 +1152,33 @@ pub mod repositories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(source_ref) = &this.source_ref { req.url_mut() .query_pairs_mut() .append_pair("sourceRef", source_ref); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories", self.client.endpoint(), &self.organization, @@ -1287,10 +1186,12 @@ pub mod repositories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1315,37 +1216,15 @@ pub mod repositories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1380,23 +1259,27 @@ pub mod repositories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}", self.client.endpoint(), &self.organization, @@ -1405,10 +1288,12 @@ pub mod repositories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1433,37 +1318,15 @@ pub mod repositories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1499,24 +1362,28 @@ pub mod repositories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}", self.client.endpoint(), &self.organization, @@ -1525,10 +1392,12 @@ pub mod repositories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1553,23 +1422,10 @@ pub mod repositories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1604,23 +1460,27 @@ pub mod repositories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}", self.client.endpoint(), &self.organization, @@ -1629,10 +1489,12 @@ pub mod repositories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1809,38 +1671,15 @@ pub mod commits { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2078,14 +1917,18 @@ pub mod commits { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(search_criteria_skip) = &this.search_criteria_skip { req.url_mut().query_pairs_mut().append_pair( @@ -2244,14 +2087,14 @@ pub mod commits { .query_pairs_mut() .append_pair("searchCriteria.user", search_criteria_user); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/commits?", self.client.endpoint(), &self.organization, @@ -2260,10 +2103,12 @@ pub mod commits { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2288,38 +2133,15 @@ pub mod commits { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2373,14 +2195,18 @@ pub mod commits { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let push_id = &this.push_id; req.url_mut() @@ -2401,14 +2227,14 @@ pub mod commits { .query_pairs_mut() .append_pair("includeLinks", &include_links.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/commits", self.client.endpoint(), &self.organization, @@ -2417,10 +2243,12 @@ pub mod commits { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2445,37 +2273,15 @@ pub mod commits { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommit = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2517,28 +2323,32 @@ pub mod commits { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(change_count) = &this.change_count { req.url_mut() .query_pairs_mut() .append_pair("changeCount", &change_count.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/commits/{}", self.client.endpoint(), &self.organization, @@ -2548,10 +2358,12 @@ pub mod commits { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2576,38 +2388,15 @@ pub mod commits { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitChanges = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2655,14 +2444,18 @@ pub mod commits { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -2674,14 +2467,14 @@ pub mod commits { .query_pairs_mut() .append_pair("skip", &skip.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/commits/{}/changes", self.client.endpoint(), &self.organization, @@ -2691,10 +2484,12 @@ pub mod commits { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2719,38 +2514,15 @@ pub mod commits { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2804,17 +2576,21 @@ pub mod commits { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(skip) = &this.skip { req.url_mut() .query_pairs_mut() @@ -2831,12 +2607,12 @@ pub mod commits { .append_pair("includeStatuses", &include_statuses.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/commitsbatch", self.client.endpoint(), &self.organization, @@ -2845,10 +2621,12 @@ pub mod commits { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2969,37 +2747,15 @@ pub mod items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3117,14 +2873,18 @@ pub mod items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let path = &this.path; req.url_mut().query_pairs_mut().append_pair("path", path); @@ -3197,14 +2957,14 @@ pub mod items { .query_pairs_mut() .append_pair("sanitize", &sanitize.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/items?path={}", self.client.endpoint(), &self.organization, @@ -3214,10 +2974,12 @@ pub mod items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3242,37 +3004,15 @@ pub mod items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitItemList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3383,14 +3123,18 @@ pub mod items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(scope_path) = &this.scope_path { req.url_mut() @@ -3456,14 +3200,14 @@ pub mod items { .query_pairs_mut() .append_pair("zipForUnix", &zip_for_unix.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/items", self.client.endpoint(), &self.organization, @@ -3472,10 +3216,12 @@ pub mod items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3500,37 +3246,15 @@ pub mod items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitItemsList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3566,24 +3290,28 @@ pub mod items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/itemsbatch", self.client.endpoint(), &self.organization, @@ -3592,10 +3320,12 @@ pub mod items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3677,37 +3407,15 @@ pub mod stats { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitBranchStats = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3772,14 +3480,18 @@ pub mod stats { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let name = &this.name; req.url_mut().query_pairs_mut().append_pair("name", name); @@ -3807,14 +3519,14 @@ pub mod stats { base_version_descriptor_version_type, ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/stats/branches?name={}", self.client.endpoint(), &self.organization, @@ -3824,10 +3536,12 @@ pub mod stats { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3852,38 +3566,15 @@ pub mod stats { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitBranchStatsList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3947,14 +3638,18 @@ pub mod stats { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(base_version_descriptor_version) = &this.base_version_descriptor_version @@ -3980,14 +3675,14 @@ pub mod stats { base_version_descriptor_version_type, ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/stats/branches", self.client.endpoint(), &self.organization, @@ -3996,10 +3691,12 @@ pub mod stats { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4109,38 +3806,15 @@ pub mod refs_favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRefFavoriteList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4186,14 +3860,18 @@ pub mod refs_favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(repository_id) = &this.repository_id { req.url_mut() @@ -4205,14 +3883,14 @@ pub mod refs_favorites { .query_pairs_mut() .append_pair("identityId", identity_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/favorites/refs", self.client.endpoint(), &self.organization, @@ -4220,10 +3898,12 @@ pub mod refs_favorites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4248,37 +3928,15 @@ pub mod refs_favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRefFavorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4313,24 +3971,28 @@ pub mod refs_favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/favorites/refs", self.client.endpoint(), &self.organization, @@ -4338,10 +4000,12 @@ pub mod refs_favorites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4366,37 +4030,15 @@ pub mod refs_favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRefFavorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4431,23 +4073,27 @@ pub mod refs_favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/favorites/refs/{}", self.client.endpoint(), &self.organization, @@ -4456,10 +4102,12 @@ pub mod refs_favorites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4484,23 +4132,10 @@ pub mod refs_favorites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4535,23 +4170,27 @@ pub mod refs_favorites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/favorites/refs/{}", self.client.endpoint(), &self.organization, @@ -4560,10 +4199,12 @@ pub mod refs_favorites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4622,48 +4263,28 @@ pub mod policy_configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PolicyConfigurationList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfigurationList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn x_ms_continuationtoken(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static( + .get_str(&azure_core::http::headers::HeaderName::from_static( "x-ms-continuationtoken", )) } @@ -4729,14 +4350,18 @@ pub mod policy_configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(repository_id) = &this.repository_id { req.url_mut() @@ -4763,14 +4388,14 @@ pub mod policy_configurations { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/policy/configurations", self.client.endpoint(), &self.organization, @@ -4778,10 +4403,12 @@ pub mod policy_configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4976,38 +4603,15 @@ pub mod pull_requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5160,14 +4764,18 @@ pub mod pull_requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(search_criteria_creator_id) = &this.search_criteria_creator_id { req.url_mut().query_pairs_mut().append_pair( @@ -5184,16 +4792,18 @@ pub mod pull_requests { ); } if let Some(search_criteria_max_time) = &this.search_criteria_max_time { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.maxTime", - &search_criteria_max_time.to_string(), - ); + let formatted_date_time = + crate::date_time::format_date_time(search_criteria_max_time)?; + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.maxTime", &formatted_date_time); } if let Some(search_criteria_min_time) = &this.search_criteria_min_time { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.minTime", - &search_criteria_min_time.to_string(), - ); + let formatted_date_time = + crate::date_time::format_date_time(search_criteria_min_time)?; + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.minTime", &formatted_date_time); } if let Some(search_criteria_query_time_range_type) = &this.search_criteria_query_time_range_type @@ -5262,14 +4872,14 @@ pub mod pull_requests { .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/pullrequests", self.client.endpoint(), &self.organization, @@ -5277,10 +4887,12 @@ pub mod pull_requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5305,37 +4917,15 @@ pub mod pull_requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequest = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5370,23 +4960,27 @@ pub mod pull_requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/pullrequests/{}", self.client.endpoint(), &self.organization, @@ -5395,10 +4989,12 @@ pub mod pull_requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5423,38 +5019,15 @@ pub mod pull_requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5608,14 +5181,18 @@ pub mod pull_requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(search_criteria_creator_id) = &this.search_criteria_creator_id { req.url_mut().query_pairs_mut().append_pair( @@ -5632,16 +5209,18 @@ pub mod pull_requests { ); } if let Some(search_criteria_max_time) = &this.search_criteria_max_time { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.maxTime", - &search_criteria_max_time.to_string(), - ); + let formatted_date_time = + crate::date_time::format_date_time(search_criteria_max_time)?; + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.maxTime", &formatted_date_time); } if let Some(search_criteria_min_time) = &this.search_criteria_min_time { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.minTime", - &search_criteria_min_time.to_string(), - ); + let formatted_date_time = + crate::date_time::format_date_time(search_criteria_min_time)?; + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.minTime", &formatted_date_time); } if let Some(search_criteria_query_time_range_type) = &this.search_criteria_query_time_range_type @@ -5710,14 +5289,14 @@ pub mod pull_requests { .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullrequests", self.client.endpoint(), &self.organization, @@ -5726,10 +5305,12 @@ pub mod pull_requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5754,37 +5335,15 @@ pub mod pull_requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequest = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5826,17 +5385,21 @@ pub mod pull_requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.create_options)?; + let req_body = azure_core::json::to_json(&this.create_options)?; if let Some(supports_iterations) = &this.supports_iterations { req.url_mut().query_pairs_mut().append_pair( "supportsIterations", @@ -5844,12 +5407,12 @@ pub mod pull_requests { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullrequests", self.client.endpoint(), &self.organization, @@ -5858,10 +5421,12 @@ pub mod pull_requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5886,37 +5451,15 @@ pub mod pull_requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequest = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5982,14 +5525,18 @@ pub mod pull_requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(max_comment_length) = &this.max_comment_length { req.url_mut() @@ -6017,14 +5564,14 @@ pub mod pull_requests { &include_work_item_refs.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullrequests/{}", self.client.endpoint(), &self.organization, @@ -6034,10 +5581,12 @@ pub mod pull_requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6062,37 +5611,15 @@ pub mod pull_requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequest = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6141,14 +5668,18 @@ pub mod pull_requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_commits) = &this.include_commits { req.url_mut() @@ -6156,7 +5687,7 @@ pub mod pull_requests { .append_pair("includeCommits", &include_commits.to_string()); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.update_options)?; + let req_body = azure_core::json::to_json(&this.update_options)?; if let Some(include_work_item_refs) = &this.include_work_item_refs { req.url_mut().query_pairs_mut().append_pair( "includeWorkItemRefs", @@ -6164,12 +5695,12 @@ pub mod pull_requests { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullrequests/{}", self.client.endpoint(), &self.organization, @@ -6179,10 +5710,12 @@ pub mod pull_requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6261,38 +5794,15 @@ pub mod annotated_tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitAnnotatedTag = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6328,24 +5838,28 @@ pub mod annotated_tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/annotatedtags", self.client.endpoint(), &self.organization, @@ -6354,10 +5868,12 @@ pub mod annotated_tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6382,38 +5898,15 @@ pub mod annotated_tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitAnnotatedTag = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6449,23 +5942,27 @@ pub mod annotated_tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/annotatedtags/{}", self.client.endpoint(), &self.organization, @@ -6475,10 +5972,12 @@ pub mod annotated_tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6562,37 +6061,13 @@ pub mod blobs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6633,29 +6108,33 @@ pub mod blobs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(filename) = &this.filename { req.url_mut() .query_pairs_mut() .append_pair("filename", filename); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/blobs", self.client.endpoint(), &self.organization, @@ -6664,10 +6143,12 @@ pub mod blobs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6692,37 +6173,15 @@ pub mod blobs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitBlobRef = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6782,14 +6241,18 @@ pub mod blobs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(download) = &this.download { req.url_mut() @@ -6811,14 +6274,14 @@ pub mod blobs { .query_pairs_mut() .append_pair("resolveLfs", &resolve_lfs.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/blobs/{}", self.client.endpoint(), &self.organization, @@ -6828,10 +6291,12 @@ pub mod blobs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6931,37 +6396,15 @@ pub mod cherry_picks { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCherryPick = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6997,27 +6440,31 @@ pub mod cherry_picks { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let ref_name = &this.ref_name; req.url_mut() .query_pairs_mut() .append_pair("refName", ref_name); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/cherryPicks", self.client.endpoint(), &self.organization, @@ -7026,10 +6473,12 @@ pub mod cherry_picks { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7054,37 +6503,15 @@ pub mod cherry_picks { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCherryPick = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7120,24 +6547,28 @@ pub mod cherry_picks { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/cherryPicks", self.client.endpoint(), &self.organization, @@ -7146,10 +6577,12 @@ pub mod cherry_picks { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7174,37 +6607,15 @@ pub mod cherry_picks { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCherryPick = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7240,23 +6651,27 @@ pub mod cherry_picks { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/cherryPicks/{}", self.client.endpoint(), &self.organization, @@ -7266,10 +6681,12 @@ pub mod cherry_picks { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7354,37 +6771,15 @@ pub mod statuses { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitStatusList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7438,14 +6833,18 @@ pub mod statuses { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -7462,14 +6861,14 @@ pub mod statuses { .query_pairs_mut() .append_pair("latestOnly", &latest_only.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/commits/{}/statuses", self.client.endpoint(), &self.organization, @@ -7479,10 +6878,12 @@ pub mod statuses { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7507,37 +6908,15 @@ pub mod statuses { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitStatus = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7574,24 +6953,28 @@ pub mod statuses { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/commits/{}/statuses", self.client.endpoint(), &self.organization, @@ -7601,10 +6984,12 @@ pub mod statuses { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7667,37 +7052,15 @@ pub mod diffs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitDiffs = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7789,14 +7152,18 @@ pub mod diffs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(diff_common_commit) = &this.diff_common_commit { req.url_mut() @@ -7843,14 +7210,14 @@ pub mod diffs { .query_pairs_mut() .append_pair("targetVersionType", target_version_type); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/diffs/commits", self.client.endpoint(), &self.organization, @@ -7859,10 +7226,12 @@ pub mod diffs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7986,38 +7355,15 @@ pub mod import_requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitImportRequestList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8058,28 +7404,32 @@ pub mod import_requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_abandoned) = &this.include_abandoned { req.url_mut() .query_pairs_mut() .append_pair("includeAbandoned", &include_abandoned.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/importRequests", self.client.endpoint(), &self.organization, @@ -8088,10 +7438,12 @@ pub mod import_requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8116,38 +7468,15 @@ pub mod import_requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitImportRequest = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8183,24 +7512,28 @@ pub mod import_requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/importRequests", self.client.endpoint(), &self.organization, @@ -8209,10 +7542,12 @@ pub mod import_requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8237,38 +7572,15 @@ pub mod import_requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitImportRequest = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8304,23 +7616,27 @@ pub mod import_requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/importRequests/{}", self.client.endpoint(), &self.organization, @@ -8330,10 +7646,12 @@ pub mod import_requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8358,38 +7676,15 @@ pub mod import_requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitImportRequest = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8426,24 +7721,28 @@ pub mod import_requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/importRequests/{}", self.client.endpoint(), &self.organization, @@ -8453,10 +7752,12 @@ pub mod import_requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8513,38 +7814,15 @@ pub mod pull_request_query { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8580,24 +7858,28 @@ pub mod pull_request_query { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullrequestquery", self.client.endpoint(), &self.organization, @@ -8606,10 +7888,12 @@ pub mod pull_request_query { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8744,37 +8028,15 @@ pub mod pull_request_attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AttachmentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8810,23 +8072,27 @@ pub mod pull_request_attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments", self.client.endpoint(), &self.organization, @@ -8836,10 +8102,12 @@ pub mod pull_request_attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8864,37 +8132,13 @@ pub mod pull_request_attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8931,23 +8175,27 @@ pub mod pull_request_attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", self.client.endpoint(), &self.organization, @@ -8958,10 +8206,12 @@ pub mod pull_request_attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8986,37 +8236,15 @@ pub mod pull_request_attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Attachment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9054,24 +8282,28 @@ pub mod pull_request_attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", self.client.endpoint(), &self.organization, @@ -9082,10 +8314,12 @@ pub mod pull_request_attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9110,23 +8344,10 @@ pub mod pull_request_attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9163,23 +8384,27 @@ pub mod pull_request_attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", self.client.endpoint(), &self.organization, @@ -9190,10 +8415,12 @@ pub mod pull_request_attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9282,38 +8509,15 @@ pub mod pull_request_commits { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9361,14 +8565,18 @@ pub mod pull_request_commits { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -9380,14 +8588,14 @@ pub mod pull_request_commits { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/commits", self.client.endpoint(), &self.organization, @@ -9397,10 +8605,12 @@ pub mod pull_request_commits { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9425,38 +8635,15 @@ pub mod pull_request_commits { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9505,14 +8692,18 @@ pub mod pull_request_commits { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -9524,14 +8715,14 @@ pub mod pull_request_commits { .query_pairs_mut() .append_pair("skip", &skip.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/commits", self.client.endpoint(), &self.organization, @@ -9542,10 +8733,12 @@ pub mod pull_request_commits { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9628,40 +8821,20 @@ pub mod pull_request_iterations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitPullRequestIterationList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestIterationList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9703,28 +8876,32 @@ pub mod pull_request_iterations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_commits) = &this.include_commits { req.url_mut() .query_pairs_mut() .append_pair("includeCommits", &include_commits.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations", self.client.endpoint(), &self.organization, @@ -9734,10 +8911,12 @@ pub mod pull_request_iterations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9763,38 +8942,18 @@ pub mod pull_request_iterations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitPullRequestIteration, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestIteration = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9831,23 +8990,27 @@ pub mod pull_request_iterations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}", self.client.endpoint(), &self.organization, @@ -9858,10 +9021,12 @@ pub mod pull_request_iterations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9925,40 +9090,20 @@ pub mod pull_request_iteration_changes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitPullRequestIterationChanges, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestIterationChanges = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10013,14 +9158,18 @@ pub mod pull_request_iteration_changes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -10037,14 +9186,14 @@ pub mod pull_request_iteration_changes { .query_pairs_mut() .append_pair("$compareTo", &compare_to.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/changes", self.client.endpoint(), &self.organization, @@ -10055,10 +9204,12 @@ pub mod pull_request_iteration_changes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10231,38 +9382,18 @@ pub mod pull_request_iteration_statuses { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitPullRequestStatusList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestStatusList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10299,23 +9430,27 @@ pub mod pull_request_iteration_statuses { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses", self.client.endpoint(), &self.organization, @@ -10326,10 +9461,12 @@ pub mod pull_request_iteration_statuses { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10355,38 +9492,15 @@ pub mod pull_request_iteration_statuses { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestStatus = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10424,24 +9538,28 @@ pub mod pull_request_iteration_statuses { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses", self.client.endpoint(), &self.organization, @@ -10452,10 +9570,12 @@ pub mod pull_request_iteration_statuses { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10480,23 +9600,10 @@ pub mod pull_request_iteration_statuses { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10534,24 +9641,28 @@ pub mod pull_request_iteration_statuses { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses", self.client.endpoint(), &self.organization, @@ -10562,10 +9673,12 @@ pub mod pull_request_iteration_statuses { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10593,38 +9706,15 @@ pub mod pull_request_iteration_statuses { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestStatus = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10662,23 +9752,27 @@ pub mod pull_request_iteration_statuses { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses/{}", self.client.endpoint(), &self.organization, @@ -10690,10 +9784,12 @@ pub mod pull_request_iteration_statuses { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10718,23 +9814,10 @@ pub mod pull_request_iteration_statuses { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10772,23 +9855,27 @@ pub mod pull_request_iteration_statuses { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses/{}", self.client.endpoint(), &self.organization, @@ -10800,10 +9887,12 @@ pub mod pull_request_iteration_statuses { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10942,38 +10031,18 @@ pub mod pull_request_labels { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WebApiTagDefinitionList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTagDefinitionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11015,28 +10084,32 @@ pub mod pull_request_labels { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(project_id) = &this.project_id { req.url_mut() .query_pairs_mut() .append_pair("projectId", project_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels", self.client.endpoint(), &self.organization, @@ -11046,10 +10119,12 @@ pub mod pull_request_labels { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11075,38 +10150,15 @@ pub mod pull_request_labels { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTagDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11149,29 +10201,33 @@ pub mod pull_request_labels { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(project_id) = &this.project_id { req.url_mut() .query_pairs_mut() .append_pair("projectId", project_id); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels", self.client.endpoint(), &self.organization, @@ -11181,10 +10237,12 @@ pub mod pull_request_labels { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11209,38 +10267,15 @@ pub mod pull_request_labels { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTagDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11283,28 +10318,32 @@ pub mod pull_request_labels { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(project_id) = &this.project_id { req.url_mut() .query_pairs_mut() .append_pair("projectId", project_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels/{}", self.client.endpoint(), &self.organization, @@ -11315,10 +10354,12 @@ pub mod pull_request_labels { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11343,23 +10384,10 @@ pub mod pull_request_labels { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11402,28 +10430,32 @@ pub mod pull_request_labels { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(project_id) = &this.project_id { req.url_mut() .query_pairs_mut() .append_pair("projectId", project_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels/{}", self.client.endpoint(), &self.organization, @@ -11434,10 +10466,12 @@ pub mod pull_request_labels { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11522,38 +10556,15 @@ pub mod pull_request_properties { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PropertiesCollection = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11589,23 +10600,27 @@ pub mod pull_request_properties { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/properties", self.client.endpoint(), &self.organization, @@ -11615,10 +10630,12 @@ pub mod pull_request_properties { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11643,38 +10660,15 @@ pub mod pull_request_properties { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PropertiesCollection = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11711,24 +10705,28 @@ pub mod pull_request_properties { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/properties", self.client.endpoint(), &self.organization, @@ -11738,10 +10736,12 @@ pub mod pull_request_properties { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11979,38 +10979,18 @@ pub mod pull_request_reviewers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::IdentityRefWithVoteList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefWithVoteList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12046,23 +11026,27 @@ pub mod pull_request_reviewers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", self.client.endpoint(), &self.organization, @@ -12072,10 +11056,12 @@ pub mod pull_request_reviewers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12101,38 +11087,18 @@ pub mod pull_request_reviewers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::IdentityRefWithVoteList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefWithVoteList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12169,24 +11135,28 @@ pub mod pull_request_reviewers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", self.client.endpoint(), &self.organization, @@ -12196,10 +11166,12 @@ pub mod pull_request_reviewers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12225,38 +11197,15 @@ pub mod pull_request_reviewers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefWithVote = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12293,24 +11242,28 @@ pub mod pull_request_reviewers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", self.client.endpoint(), &self.organization, @@ -12320,10 +11273,12 @@ pub mod pull_request_reviewers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12348,23 +11303,10 @@ pub mod pull_request_reviewers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12401,24 +11343,28 @@ pub mod pull_request_reviewers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", self.client.endpoint(), &self.organization, @@ -12428,10 +11374,12 @@ pub mod pull_request_reviewers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12459,38 +11407,15 @@ pub mod pull_request_reviewers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefWithVote = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12527,23 +11452,27 @@ pub mod pull_request_reviewers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", self.client.endpoint(), &self.organization, @@ -12554,10 +11483,12 @@ pub mod pull_request_reviewers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12582,38 +11513,15 @@ pub mod pull_request_reviewers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefWithVote = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12651,24 +11559,28 @@ pub mod pull_request_reviewers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", self.client.endpoint(), &self.organization, @@ -12679,10 +11591,12 @@ pub mod pull_request_reviewers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12707,38 +11621,15 @@ pub mod pull_request_reviewers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefWithVote = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12776,24 +11667,28 @@ pub mod pull_request_reviewers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", self.client.endpoint(), &self.organization, @@ -12804,10 +11699,12 @@ pub mod pull_request_reviewers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12832,23 +11729,10 @@ pub mod pull_request_reviewers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12885,23 +11769,27 @@ pub mod pull_request_reviewers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", self.client.endpoint(), &self.organization, @@ -12912,10 +11800,12 @@ pub mod pull_request_reviewers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12977,23 +11867,10 @@ pub mod pull_request_share { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13030,24 +11907,28 @@ pub mod pull_request_share { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/share", self.client.endpoint(), &self.organization, @@ -13057,10 +11938,12 @@ pub mod pull_request_share { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13220,38 +12103,18 @@ pub mod pull_request_statuses { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitPullRequestStatusList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestStatusList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13287,23 +12150,27 @@ pub mod pull_request_statuses { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", self.client.endpoint(), &self.organization, @@ -13313,10 +12180,12 @@ pub mod pull_request_statuses { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13342,38 +12211,15 @@ pub mod pull_request_statuses { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestStatus = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13410,24 +12256,28 @@ pub mod pull_request_statuses { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", self.client.endpoint(), &self.organization, @@ -13437,10 +12287,12 @@ pub mod pull_request_statuses { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13465,23 +12317,10 @@ pub mod pull_request_statuses { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13518,24 +12357,28 @@ pub mod pull_request_statuses { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", self.client.endpoint(), &self.organization, @@ -13545,10 +12388,12 @@ pub mod pull_request_statuses { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13576,38 +12421,15 @@ pub mod pull_request_statuses { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestStatus = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13644,23 +12466,27 @@ pub mod pull_request_statuses { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses/{}", self.client.endpoint(), &self.organization, @@ -13671,10 +12497,12 @@ pub mod pull_request_statuses { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13699,23 +12527,10 @@ pub mod pull_request_statuses { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13752,23 +12567,27 @@ pub mod pull_request_statuses { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses/{}", self.client.endpoint(), &self.organization, @@ -13779,10 +12598,12 @@ pub mod pull_request_statuses { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13924,40 +12745,20 @@ pub mod pull_request_threads { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitPullRequestCommentThreadList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestCommentThreadList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14005,14 +12806,18 @@ pub mod pull_request_threads { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(iteration) = &this.iteration { req.url_mut() @@ -14024,14 +12829,14 @@ pub mod pull_request_threads { .query_pairs_mut() .append_pair("$baseIteration", &base_iteration.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads", self.client.endpoint(), &self.organization, @@ -14041,10 +12846,12 @@ pub mod pull_request_threads { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14070,40 +12877,20 @@ pub mod pull_request_threads { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitPullRequestCommentThread, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestCommentThread = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14140,24 +12927,28 @@ pub mod pull_request_threads { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads", self.client.endpoint(), &self.organization, @@ -14167,10 +12958,12 @@ pub mod pull_request_threads { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14196,40 +12989,20 @@ pub mod pull_request_threads { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitPullRequestCommentThread, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestCommentThread = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14278,14 +13051,18 @@ pub mod pull_request_threads { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(iteration) = &this.iteration { req.url_mut() @@ -14297,14 +13074,14 @@ pub mod pull_request_threads { .query_pairs_mut() .append_pair("$baseIteration", &base_iteration.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}", self.client.endpoint(), &self.organization, @@ -14315,10 +13092,12 @@ pub mod pull_request_threads { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14344,40 +13123,20 @@ pub mod pull_request_threads { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitPullRequestCommentThread, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestCommentThread = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14415,24 +13174,28 @@ pub mod pull_request_threads { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}", self.client.endpoint(), &self.organization, @@ -14443,10 +13206,12 @@ pub mod pull_request_threads { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14622,37 +13387,15 @@ pub mod pull_request_thread_comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14689,23 +13432,27 @@ pub mod pull_request_thread_comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments", self.client.endpoint(), &self.organization, @@ -14716,10 +13463,12 @@ pub mod pull_request_thread_comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14744,37 +13493,15 @@ pub mod pull_request_thread_comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14812,24 +13539,28 @@ pub mod pull_request_thread_comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments", self.client.endpoint(), &self.organization, @@ -14840,10 +13571,12 @@ pub mod pull_request_thread_comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14868,37 +13601,15 @@ pub mod pull_request_thread_comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14936,23 +13647,27 @@ pub mod pull_request_thread_comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}", self.client.endpoint(), &self.organization, @@ -14964,10 +13679,12 @@ pub mod pull_request_thread_comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14992,37 +13709,15 @@ pub mod pull_request_thread_comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -15061,24 +13756,28 @@ pub mod pull_request_thread_comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}", self.client.endpoint(), &self.organization, @@ -15090,10 +13789,12 @@ pub mod pull_request_thread_comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -15118,23 +13819,10 @@ pub mod pull_request_thread_comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -15172,23 +13860,27 @@ pub mod pull_request_thread_comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}", self.client.endpoint(), &self.organization, @@ -15200,10 +13892,12 @@ pub mod pull_request_thread_comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -15325,38 +14019,15 @@ pub mod pull_request_comment_likes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -15394,29 +14065,35 @@ pub mod pull_request_comment_likes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}/likes" , self . client . endpoint () , & self . organization , & self . project , & self . repository_id , & self . pull_request_id , & self . thread_id , & self . comment_id)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}/likes" , self . client . endpoint () , & self . organization , & self . project , & self . repository_id , & self . pull_request_id , & self . thread_id , & self . comment_id)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -15441,23 +14118,10 @@ pub mod pull_request_comment_likes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -15495,30 +14159,36 @@ pub mod pull_request_comment_likes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}/likes" , self . client . endpoint () , & self . organization , & self . project , & self . repository_id , & self . pull_request_id , & self . thread_id , & self . comment_id)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}/likes" , self . client . endpoint () , & self . organization , & self . project , & self . repository_id , & self . pull_request_id , & self . thread_id , & self . comment_id)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -15546,23 +14216,10 @@ pub mod pull_request_comment_likes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -15600,29 +14257,35 @@ pub mod pull_request_comment_likes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}/likes" , self . client . endpoint () , & self . organization , & self . project , & self . repository_id , & self . pull_request_id , & self . thread_id , & self . comment_id)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}/likes" , self . client . endpoint () , & self . organization , & self . project , & self . repository_id , & self . pull_request_id , & self . thread_id , & self . comment_id)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -15682,38 +14345,15 @@ pub mod pull_request_work_items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -15749,23 +14389,27 @@ pub mod pull_request_work_items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/workitems", self.client.endpoint(), &self.organization, @@ -15775,10 +14419,12 @@ pub mod pull_request_work_items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -15885,37 +14531,15 @@ pub mod pushes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPushList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -16017,14 +14641,18 @@ pub mod pushes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(skip) = &this.skip { req.url_mut() @@ -16037,10 +14665,11 @@ pub mod pushes { .append_pair("$top", &top.to_string()); } if let Some(search_criteria_from_date) = &this.search_criteria_from_date { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.fromDate", - &search_criteria_from_date.to_string(), - ); + let formatted_date_time = + crate::date_time::format_date_time(search_criteria_from_date)?; + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.fromDate", &formatted_date_time); } if let Some(search_criteria_include_links) = &this.search_criteria_include_links @@ -16069,19 +14698,20 @@ pub mod pushes { .append_pair("searchCriteria.refName", search_criteria_ref_name); } if let Some(search_criteria_to_date) = &this.search_criteria_to_date { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.toDate", - &search_criteria_to_date.to_string(), - ); + let formatted_date_time = + crate::date_time::format_date_time(search_criteria_to_date)?; + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.toDate", &formatted_date_time); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pushes", self.client.endpoint(), &self.organization, @@ -16090,10 +14720,12 @@ pub mod pushes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -16118,37 +14750,15 @@ pub mod pushes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPush = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -16184,24 +14794,28 @@ pub mod pushes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pushes", self.client.endpoint(), &self.organization, @@ -16210,10 +14824,12 @@ pub mod pushes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -16238,37 +14854,15 @@ pub mod pushes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPush = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -16316,14 +14910,18 @@ pub mod pushes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_commits) = &this.include_commits { req.url_mut() @@ -16335,14 +14933,14 @@ pub mod pushes { .query_pairs_mut() .append_pair("includeRefUpdates", &include_ref_updates.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/pushes/{}", self.client.endpoint(), &self.organization, @@ -16352,10 +14950,12 @@ pub mod pushes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -16467,37 +15067,15 @@ pub mod refs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRefList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -16586,14 +15164,18 @@ pub mod refs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(filter) = &this.filter { req.url_mut() @@ -16641,14 +15223,14 @@ pub mod refs { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/refs", self.client.endpoint(), &self.organization, @@ -16657,10 +15239,12 @@ pub mod refs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -16685,38 +15269,18 @@ pub mod refs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitRefUpdateResultList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRefUpdateResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -16758,29 +15322,33 @@ pub mod refs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(project_id) = &this.project_id { req.url_mut() .query_pairs_mut() .append_pair("projectId", project_id); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/refs", self.client.endpoint(), &self.organization, @@ -16789,10 +15357,12 @@ pub mod refs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -16818,37 +15388,15 @@ pub mod refs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRef = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -16891,17 +15439,21 @@ pub mod refs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let filter = &this.filter; req.url_mut() .query_pairs_mut() @@ -16912,12 +15464,12 @@ pub mod refs { .append_pair("projectId", project_id); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/refs", self.client.endpoint(), &self.organization, @@ -16926,10 +15478,12 @@ pub mod refs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -17029,37 +15583,15 @@ pub mod reverts { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRevert = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -17095,27 +15627,31 @@ pub mod reverts { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let ref_name = &this.ref_name; req.url_mut() .query_pairs_mut() .append_pair("refName", ref_name); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/reverts", self.client.endpoint(), &self.organization, @@ -17124,10 +15660,12 @@ pub mod reverts { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -17152,37 +15690,15 @@ pub mod reverts { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRevert = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -17218,24 +15734,28 @@ pub mod reverts { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/reverts", self.client.endpoint(), &self.organization, @@ -17244,10 +15764,12 @@ pub mod reverts { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -17272,37 +15794,15 @@ pub mod reverts { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRevert = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -17338,23 +15838,27 @@ pub mod reverts { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/reverts/{}", self.client.endpoint(), &self.organization, @@ -17364,10 +15868,12 @@ pub mod reverts { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -17421,38 +15927,15 @@ pub mod suggestions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitSuggestionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -17487,23 +15970,27 @@ pub mod suggestions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/suggestions", self.client.endpoint(), &self.organization, @@ -17512,10 +15999,12 @@ pub mod suggestions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -17576,37 +16065,15 @@ pub mod trees { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitTreeRef = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -17666,14 +16133,18 @@ pub mod trees { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(project_id) = &this.project_id { req.url_mut() @@ -17695,14 +16166,14 @@ pub mod trees { .query_pairs_mut() .append_pair("$format", format); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/trees/{}", self.client.endpoint(), &self.organization, @@ -17712,10 +16183,12 @@ pub mod trees { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -17777,38 +16250,15 @@ pub mod merge_bases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -17857,14 +16307,18 @@ pub mod merge_bases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let other_commit_id = &this.other_commit_id; req.url_mut() @@ -17880,14 +16334,14 @@ pub mod merge_bases { .query_pairs_mut() .append_pair("otherRepositoryId", other_repository_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/commits/{}/mergebases", self.client.endpoint(), &self.organization, @@ -17897,10 +16351,12 @@ pub mod merge_bases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -18025,38 +16481,15 @@ pub mod forks { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepositoryRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -18098,28 +16531,32 @@ pub mod forks { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_links) = &this.include_links { req.url_mut() .query_pairs_mut() .append_pair("includeLinks", &include_links.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/forks/{}", self.client.endpoint(), &self.organization, @@ -18129,10 +16566,12 @@ pub mod forks { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -18157,38 +16596,18 @@ pub mod forks { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GitForkSyncRequestList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitForkSyncRequestList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -18235,14 +16654,18 @@ pub mod forks { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_abandoned) = &this.include_abandoned { req.url_mut() @@ -18254,14 +16677,14 @@ pub mod forks { .query_pairs_mut() .append_pair("includeLinks", &include_links.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests", self.client.endpoint(), &self.organization, @@ -18270,10 +16693,12 @@ pub mod forks { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -18299,38 +16724,15 @@ pub mod forks { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitForkSyncRequest = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -18372,29 +16774,33 @@ pub mod forks { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(include_links) = &this.include_links { req.url_mut() .query_pairs_mut() .append_pair("includeLinks", &include_links.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests", self.client.endpoint(), &self.organization, @@ -18403,10 +16809,12 @@ pub mod forks { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -18431,38 +16839,15 @@ pub mod forks { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitForkSyncRequest = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -18504,28 +16889,32 @@ pub mod forks { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_links) = &this.include_links { req.url_mut() .query_pairs_mut() .append_pair("includeLinks", &include_links.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests/{}", self.client.endpoint(), &self.organization, @@ -18535,10 +16924,12 @@ pub mod forks { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -18619,37 +17010,15 @@ pub mod merges { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitMerge = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -18691,29 +17060,33 @@ pub mod merges { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(include_links) = &this.include_links { req.url_mut() .query_pairs_mut() .append_pair("includeLinks", &include_links.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/merges", self.client.endpoint(), &self.organization, @@ -18722,10 +17095,12 @@ pub mod merges { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -18750,37 +17125,15 @@ pub mod merges { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GitMerge = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -18822,28 +17175,32 @@ pub mod merges { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_links) = &this.include_links { req.url_mut() .query_pairs_mut() .append_pair("includeLinks", &include_links.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/git/repositories/{}/merges/{}", self.client.endpoint(), &self.organization, @@ -18853,10 +17210,12 @@ pub mod merges { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/git/models.rs b/azure_devops_rust_api/src/git/models.rs index 2f0d90cd..9f8323a1 100644 --- a/azure_devops_rust_api/src/git/models.rs +++ b/azure_devops_rust_api/src/git/models.rs @@ -242,7 +242,7 @@ pub struct AttachmentList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -353,7 +353,8 @@ pub struct Change { #[doc = "The type of change that was made to the item."] #[serde(rename = "changeType")] pub change_type: change::ChangeType, - pub item: serde_json::Value, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option, #[serde( rename = "newContent", default, @@ -372,10 +373,10 @@ pub struct Change { pub url: Option, } impl Change { - pub fn new(change_type: change::ChangeType, item: serde_json::Value) -> Self { + pub fn new(change_type: change::ChangeType) -> Self { Self { change_type, - item, + item: None, new_content: None, source_server_item: None, url: None, @@ -446,7 +447,7 @@ pub struct ChangeList { pub change_counts: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub changes: Vec, @@ -467,7 +468,7 @@ pub struct ChangeList { pub creation_date: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub notes: Vec, @@ -537,7 +538,7 @@ pub struct ChangeListSearchCriteria { #[serde( rename = "itemPaths", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub item_paths: Vec, @@ -640,7 +641,7 @@ pub struct Comment { #[serde( rename = "usersLiked", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub users_liked: Vec, @@ -694,7 +695,7 @@ pub struct CommentList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -727,7 +728,7 @@ pub struct CommentThread { #[doc = "A list of the comments."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub comments: Vec, @@ -946,7 +947,7 @@ pub struct FileDiff { #[serde( rename = "lineDiffBlocks", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub line_diff_blocks: Vec, @@ -999,7 +1000,7 @@ pub struct FileDiffsCriteria { #[serde( rename = "fileDiffParams", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub file_diff_params: Vec, @@ -1187,7 +1188,7 @@ pub struct GitAsyncRefOperationSource { #[serde( rename = "commitList", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub commit_list: Vec, @@ -1319,7 +1320,7 @@ pub struct GitBranchStatsList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1399,7 +1400,7 @@ pub struct GitCommitChanges { pub change_counts: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub changes: Vec, @@ -1443,7 +1444,7 @@ pub struct GitCommitDiffs { pub change_counts: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub changes: Vec, @@ -1483,7 +1484,7 @@ pub struct GitCommitRef { #[doc = "An enumeration of the changes included with the commit."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub changes: Vec, @@ -1513,7 +1514,7 @@ pub struct GitCommitRef { #[doc = "An enumeration of the parent commit IDs for this commit."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub parents: Vec, @@ -1525,7 +1526,7 @@ pub struct GitCommitRef { #[doc = "A list of status metadata from services and extensions that may associate additional information to the commit."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub statuses: Vec, @@ -1536,7 +1537,7 @@ pub struct GitCommitRef { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec, @@ -1552,7 +1553,7 @@ pub struct GitCommitRefList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1571,7 +1572,7 @@ pub struct GitCommitToCreate { #[serde( rename = "pathActions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub path_actions: Vec, @@ -2200,7 +2201,7 @@ pub struct GitDeletedRepositoryList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2216,7 +2217,7 @@ pub struct GitFilePathsCollection { pub commit_id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub paths: Vec, @@ -2235,7 +2236,7 @@ pub struct GitForkOperationStatusDetail { #[serde( rename = "allSteps", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub all_steps: Vec, @@ -2302,7 +2303,7 @@ pub struct GitForkSyncRequest { #[serde( rename = "sourceToTargetRefs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub source_to_target_refs: Vec, @@ -2336,7 +2337,7 @@ pub struct GitForkSyncRequestList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2356,7 +2357,7 @@ pub struct GitForkSyncRequestParameters { #[serde( rename = "sourceToTargetRefs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub source_to_target_refs: Vec, @@ -2473,7 +2474,7 @@ pub struct GitImportRequestList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2523,7 +2524,7 @@ pub struct GitImportStatusDetail { #[serde( rename = "allSteps", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub all_steps: Vec, @@ -2729,7 +2730,7 @@ pub struct GitItemList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2759,7 +2760,7 @@ pub struct GitItemRequestData { #[serde( rename = "itemDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub item_descriptors: Vec, @@ -2783,7 +2784,7 @@ pub struct GitItemsList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2812,14 +2813,14 @@ pub struct GitLastChangeTreeItems { #[doc = "The list of commits referenced by Items, if they were requested."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub commits: Vec, #[doc = "The last change of items."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub items: Vec, @@ -2938,7 +2939,7 @@ pub struct GitMergeParameters { #[doc = "An enumeration of the parent commit IDs for the merge commit."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub parents: Vec, @@ -3058,7 +3059,7 @@ pub struct GitPolicyConfigurationResponse { #[serde( rename = "policyConfigurations", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub policy_configurations: Vec, @@ -3107,7 +3108,7 @@ pub struct GitPullRequest { #[doc = "The commits contained in the pull request."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub commits: Vec, @@ -3154,7 +3155,7 @@ pub struct GitPullRequest { #[doc = "The labels associated with the pull request."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub labels: Vec, @@ -3220,7 +3221,7 @@ pub struct GitPullRequest { #[doc = "A list of reviewers on the pull request along with the state of their votes."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub reviewers: Vec, @@ -3248,7 +3249,7 @@ pub struct GitPullRequest { #[serde( rename = "workItemRefs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_refs: Vec, @@ -3424,7 +3425,7 @@ pub struct GitPullRequestCommentThreadList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3441,7 +3442,7 @@ pub struct GitPullRequestCompletionOptions { #[serde( rename = "autoCompleteIgnoreConfigIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub auto_complete_ignore_config_ids: Vec, @@ -3534,7 +3535,7 @@ pub struct GitPullRequestCreateOptions { #[doc = "The labels associated with the pull request."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub labels: Vec, @@ -3564,14 +3565,14 @@ pub struct GitPullRequestCreateOptions { #[serde( rename = "workItemRefs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_refs: Vec, #[doc = "A list of reviewers on the pull request."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub reviewers: Vec, @@ -3604,14 +3605,14 @@ pub struct GitPullRequestIteration { #[serde( rename = "changeList", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub change_list: Vec, #[doc = "The commits included with the pull request iteration."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub commits: Vec, @@ -3718,7 +3719,7 @@ pub struct GitPullRequestIterationChanges { #[serde( rename = "changeEntries", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub change_entries: Vec, @@ -3740,7 +3741,7 @@ pub struct GitPullRequestIterationList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3756,7 +3757,7 @@ pub struct GitPullRequestList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3801,14 +3802,14 @@ pub struct GitPullRequestQuery { #[doc = "The queries to perform."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub queries: Vec, #[doc = "The results of the queries. This matches the QueryInputs list so Results\\[n\\] are the results of QueryInputs\\[n\\]. Each entry in the list is a dictionary of commit->pull requests."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -3824,7 +3825,7 @@ pub struct GitPullRequestQueryInput { #[doc = "The list of commit IDs to search for."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub items: Vec, @@ -3999,7 +4000,7 @@ pub struct GitPullRequestStatusList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4021,7 +4022,7 @@ pub struct GitPullRequestUpdateOptions { #[doc = "A list of reviewers on the pull request."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub reviewers: Vec, @@ -4041,6 +4042,13 @@ pub struct GitPullRequestUpdateOptions { skip_serializing_if = "Option::is_none" )] pub auto_complete_set_by: Option, + #[doc = "Preferences about how the pull request should be completed."] + #[serde( + rename = "completionOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub completion_options: Option, } impl GitPullRequestUpdateOptions { pub fn new() -> Self { @@ -4053,14 +4061,14 @@ pub struct GitPush { pub git_push_ref: GitPushRef, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub commits: Vec, #[serde( rename = "refUpdates", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ref_updates: Vec, @@ -4082,7 +4090,7 @@ pub struct GitPushEventData { pub branch: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub commits: Vec, @@ -4100,7 +4108,7 @@ pub struct GitPushList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4183,7 +4191,7 @@ pub struct GitQueryBranchStatsCriteria { #[serde( rename = "targetCommits", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub target_commits: Vec, @@ -4237,7 +4245,7 @@ pub struct GitQueryCommitsCriteria { #[doc = "If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ids: Vec, @@ -4325,7 +4333,7 @@ pub struct GitQueryRefsCriteria { #[serde( rename = "commitIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub commit_ids: Vec, @@ -4333,7 +4341,7 @@ pub struct GitQueryRefsCriteria { #[serde( rename = "refNames", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ref_names: Vec, @@ -4400,7 +4408,7 @@ pub struct GitRef { pub peeled_object_id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub statuses: Vec, @@ -4471,7 +4479,7 @@ pub struct GitRefFavoriteList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4487,7 +4495,7 @@ pub struct GitRefList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4631,7 +4639,7 @@ pub struct GitRefUpdateResultList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4690,7 +4698,7 @@ pub struct GitRepository { #[serde( rename = "validRemoteUrls", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub valid_remote_urls: Vec, @@ -4743,7 +4751,7 @@ pub struct GitRepositoryList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4786,7 +4794,7 @@ pub struct GitRepositoryRefList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4853,7 +4861,7 @@ pub struct GitResolutionMergeContent { #[serde( rename = "userMergedContent", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub user_merged_content: Vec, @@ -5060,7 +5068,7 @@ pub struct GitStatusList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -5091,7 +5099,7 @@ pub struct GitSuggestionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -5182,7 +5190,7 @@ pub struct GitTreeDiff { #[serde( rename = "diffEntries", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub diff_entries: Vec, @@ -5304,7 +5312,7 @@ pub struct GitTreeDiffResponse { #[serde( rename = "continuationToken", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub continuation_token: Vec, @@ -5388,7 +5396,7 @@ pub struct GitTreeRef { #[serde( rename = "treeEntries", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tree_entries: Vec, @@ -5675,7 +5683,7 @@ pub struct IdentityRefList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -5728,7 +5736,7 @@ pub struct IdentityRefWithVote { #[serde( rename = "votedFor", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub voted_for: Vec, @@ -5753,7 +5761,7 @@ pub struct IdentityRefWithVoteList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -5799,7 +5807,7 @@ pub struct IncludedGitCommit { #[serde( rename = "parentCommitIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub parent_commit_ids: Vec, @@ -6107,7 +6115,7 @@ pub struct PolicyConfigurationList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -6179,14 +6187,14 @@ pub struct PropertiesCollection { #[doc = "The set of keys in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub keys: Vec, #[doc = "The set of values in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -6317,7 +6325,7 @@ pub struct ResourceRefList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -6380,7 +6388,7 @@ pub struct ShareNotificationContext { #[doc = "Identities of users who will receive a share notification."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub receivers: Vec, @@ -6464,7 +6472,7 @@ pub struct SupportedIde { #[serde( rename = "supportedPlatforms", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub supported_platforms: Vec, @@ -6630,14 +6638,14 @@ pub struct TfvcBranch { #[doc = "List of children for the branch."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub children: Vec, #[doc = "List of branch mappings."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mappings: Vec, @@ -6648,7 +6656,7 @@ pub struct TfvcBranch { #[serde( rename = "relatedBranches", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub related_branches: Vec, @@ -6722,7 +6730,7 @@ pub struct TfvcChange { #[serde( rename = "mergeSources", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub merge_sources: Vec, @@ -6754,7 +6762,7 @@ pub struct TfvcChangeset { #[doc = "List of associated changes."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub changes: Vec, @@ -6762,7 +6770,7 @@ pub struct TfvcChangeset { #[serde( rename = "checkinNotes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub checkin_notes: Vec, @@ -6791,7 +6799,7 @@ pub struct TfvcChangeset { #[serde( rename = "teamProjectIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub team_project_ids: Vec, @@ -6799,7 +6807,7 @@ pub struct TfvcChangeset { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec, @@ -6888,7 +6896,7 @@ pub struct TfvcChangesetSearchCriteria { pub item_path: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mappings: Vec, @@ -6911,7 +6919,7 @@ pub struct TfvcChangesetsRequestData { #[serde( rename = "changesetIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub changeset_ids: Vec, @@ -7132,7 +7140,7 @@ pub struct TfvcItemRequestData { #[serde( rename = "itemDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub item_descriptors: Vec, @@ -7150,7 +7158,7 @@ pub struct TfvcLabel { #[doc = "List of items."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub items: Vec, @@ -7314,7 +7322,7 @@ pub struct TfvcPolicyOverrideInfo { #[serde( rename = "policyFailures", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub policy_failures: Vec, @@ -7344,14 +7352,14 @@ pub struct TfvcShelveset { #[doc = "List of changes."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub changes: Vec, #[doc = "List of checkin notes."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub notes: Vec, @@ -7366,7 +7374,7 @@ pub struct TfvcShelveset { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec, @@ -7559,7 +7567,7 @@ pub struct UpdateRefsRequest { #[serde( rename = "refUpdateRequests", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ref_update_requests: Vec, @@ -7701,7 +7709,7 @@ pub struct WebApiTagDefinitionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/graph/mod.rs b/azure_devops_rust_api/src/graph/mod.rs index 0b7d0d94..831e5e62 100644 --- a/azure_devops_rust_api/src/graph/mod.rs +++ b/azure_devops_rust_api/src/graph/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://vssps.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -198,38 +199,15 @@ pub mod descriptors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphDescriptorResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -263,23 +241,27 @@ pub mod descriptors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/descriptors/{}", self.client.endpoint(), &self.organization, @@ -287,10 +269,12 @@ pub mod descriptors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -407,47 +391,25 @@ pub mod groups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphGroupList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn x_ms_continuation_token(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static( + .get_str(&azure_core::http::headers::HeaderName::from_static( "x-ms-continuationtoken", )) } @@ -500,14 +462,18 @@ pub mod groups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(scope_descriptor) = &this.scope_descriptor { req.url_mut() @@ -524,24 +490,26 @@ pub mod groups { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/groups", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -566,37 +534,15 @@ pub mod groups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -642,17 +588,21 @@ pub mod groups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(scope_descriptor) = &this.scope_descriptor { req.url_mut() .query_pairs_mut() @@ -664,22 +614,24 @@ pub mod groups { .append_pair("groupDescriptors", group_descriptors); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/groups", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -704,37 +656,15 @@ pub mod groups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -768,23 +698,27 @@ pub mod groups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/groups/{}", self.client.endpoint(), &self.organization, @@ -792,10 +726,12 @@ pub mod groups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -820,37 +756,15 @@ pub mod groups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -885,24 +799,28 @@ pub mod groups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/groups/{}", self.client.endpoint(), &self.organization, @@ -910,10 +828,12 @@ pub mod groups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -938,23 +858,10 @@ pub mod groups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -988,23 +895,27 @@ pub mod groups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/groups/{}", self.client.endpoint(), &self.organization, @@ -1012,10 +923,12 @@ pub mod groups { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1147,38 +1060,15 @@ pub mod memberships { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphMembershipList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1224,14 +1114,18 @@ pub mod memberships { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(direction) = &this.direction { req.url_mut() @@ -1243,14 +1137,14 @@ pub mod memberships { .query_pairs_mut() .append_pair("depth", &depth.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/Memberships/{}", self.client.endpoint(), &self.organization, @@ -1258,10 +1152,12 @@ pub mod memberships { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1286,38 +1182,15 @@ pub mod memberships { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphMembership = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1352,23 +1225,27 @@ pub mod memberships { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/memberships/{}/{}", self.client.endpoint(), &self.organization, @@ -1377,10 +1254,12 @@ pub mod memberships { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1405,38 +1284,15 @@ pub mod memberships { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphMembership = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1471,23 +1327,27 @@ pub mod memberships { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/memberships/{}/{}", self.client.endpoint(), &self.organization, @@ -1496,10 +1356,12 @@ pub mod memberships { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1524,23 +1386,10 @@ pub mod memberships { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1575,23 +1424,27 @@ pub mod memberships { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/memberships/{}/{}", self.client.endpoint(), &self.organization, @@ -1600,10 +1453,12 @@ pub mod memberships { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1631,23 +1486,10 @@ pub mod memberships { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1682,23 +1524,27 @@ pub mod memberships { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Head); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/memberships/{}/{}", self.client.endpoint(), &self.organization, @@ -1707,10 +1553,12 @@ pub mod memberships { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1764,38 +1612,15 @@ pub mod membership_states { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphMembershipState = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1829,23 +1654,27 @@ pub mod membership_states { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/membershipstates/{}", self.client.endpoint(), &self.organization, @@ -1853,10 +1682,12 @@ pub mod membership_states { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1904,23 +1735,10 @@ pub mod request_access { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1954,34 +1772,40 @@ pub mod request_access { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/requestaccess", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2080,48 +1904,28 @@ pub mod service_principals { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GraphServicePrincipalList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphServicePrincipalList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn x_ms_continuation_token(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static( + .get_str(&azure_core::http::headers::HeaderName::from_static( "x-ms-continuationtoken", )) } @@ -2168,14 +1972,18 @@ pub mod service_principals { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(continuation_token) = &this.continuation_token { req.url_mut() @@ -2187,24 +1995,26 @@ pub mod service_principals { .query_pairs_mut() .append_pair("scopeDescriptor", scope_descriptor); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/serviceprincipals", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2230,38 +2040,15 @@ pub mod service_principals { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphServicePrincipal = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2301,39 +2088,45 @@ pub mod service_principals { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(group_descriptors) = &this.group_descriptors { req.url_mut() .query_pairs_mut() .append_pair("groupDescriptors", group_descriptors); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/serviceprincipals", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2358,38 +2151,15 @@ pub mod service_principals { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphServicePrincipal = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2423,23 +2193,27 @@ pub mod service_principals { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/serviceprincipals/{}", self.client.endpoint(), &self.organization, @@ -2447,10 +2221,12 @@ pub mod service_principals { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2475,23 +2251,10 @@ pub mod service_principals { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2525,23 +2288,27 @@ pub mod service_principals { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/serviceprincipals/{}", self.client.endpoint(), &self.organization, @@ -2549,10 +2316,12 @@ pub mod service_principals { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2605,38 +2374,15 @@ pub mod storage_keys { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphStorageKeyResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2670,23 +2416,27 @@ pub mod storage_keys { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/storagekeys/{}", self.client.endpoint(), &self.organization, @@ -2694,10 +2444,12 @@ pub mod storage_keys { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2748,37 +2500,15 @@ pub mod subject_lookup { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: serde_json::Value = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2812,34 +2542,40 @@ pub mod subject_lookup { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/subjectlookup", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2890,38 +2626,15 @@ pub mod subject_query { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphSubjectList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2955,34 +2668,40 @@ pub mod subject_query { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/subjectquery", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3060,37 +2779,15 @@ pub mod avatars { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Avatar = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3134,14 +2831,18 @@ pub mod avatars { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(size) = &this.size { req.url_mut().query_pairs_mut().append_pair("size", size); @@ -3151,14 +2852,14 @@ pub mod avatars { .query_pairs_mut() .append_pair("format", format); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/Subjects/{}/avatars", self.client.endpoint(), &self.organization, @@ -3166,10 +2867,12 @@ pub mod avatars { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3194,23 +2897,10 @@ pub mod avatars { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3245,24 +2935,28 @@ pub mod avatars { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/Subjects/{}/avatars", self.client.endpoint(), &self.organization, @@ -3270,10 +2964,12 @@ pub mod avatars { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3301,23 +2997,10 @@ pub mod avatars { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3351,23 +3034,27 @@ pub mod avatars { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/Subjects/{}/avatars", self.client.endpoint(), &self.organization, @@ -3375,10 +3062,12 @@ pub mod avatars { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3497,47 +3186,25 @@ pub mod users { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphUserList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn x_ms_continuation_token(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static( + .get_str(&azure_core::http::headers::HeaderName::from_static( "x-ms-continuationtoken", )) } @@ -3590,14 +3257,18 @@ pub mod users { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(subject_types) = &this.subject_types { req.url_mut() @@ -3614,24 +3285,26 @@ pub mod users { .query_pairs_mut() .append_pair("scopeDescriptor", scope_descriptor); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/users", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3656,37 +3329,15 @@ pub mod users { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphUser = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3726,39 +3377,45 @@ pub mod users { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(group_descriptors) = &this.group_descriptors { req.url_mut() .query_pairs_mut() .append_pair("groupDescriptors", group_descriptors); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/users", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3783,37 +3440,15 @@ pub mod users { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphUser = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3847,23 +3482,27 @@ pub mod users { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/users/{}", self.client.endpoint(), &self.organization, @@ -3871,10 +3510,12 @@ pub mod users { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3899,37 +3540,15 @@ pub mod users { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphUser = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3964,24 +3583,28 @@ pub mod users { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/users/{}", self.client.endpoint(), &self.organization, @@ -3989,10 +3612,12 @@ pub mod users { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4017,23 +3642,10 @@ pub mod users { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4067,23 +3679,27 @@ pub mod users { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/users/{}", self.client.endpoint(), &self.organization, @@ -4091,10 +3707,12 @@ pub mod users { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4145,38 +3763,15 @@ pub mod provider_info { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphProviderInfo = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4210,23 +3805,27 @@ pub mod provider_info { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/graph/Users/{}/providerinfo", self.client.endpoint(), &self.organization, @@ -4234,10 +3833,12 @@ pub mod provider_info { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/graph/models.rs b/azure_devops_rust_api/src/graph/models.rs index eae0a144..de8777df 100644 --- a/azure_devops_rust_api/src/graph/models.rs +++ b/azure_devops_rust_api/src/graph/models.rs @@ -51,7 +51,7 @@ pub struct Avatar { pub time_stamp: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -136,14 +136,14 @@ pub struct GraphGlobalExtendedPropertyBatch { #[serde( rename = "propertyNameFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub property_name_filters: Vec, #[serde( rename = "subjectDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub subject_descriptors: Vec, @@ -189,7 +189,7 @@ pub struct GraphGroupList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -332,7 +332,7 @@ pub struct GraphMembershipList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -384,7 +384,7 @@ pub struct GraphMembershipTraversal { #[serde( rename = "traversedSubjectIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub traversed_subject_ids: Vec, @@ -392,7 +392,7 @@ pub struct GraphMembershipTraversal { #[serde( rename = "traversedSubjects", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub traversed_subjects: Vec, @@ -564,7 +564,7 @@ pub struct GraphServicePrincipalList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -683,7 +683,7 @@ pub struct GraphSubjectList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -699,7 +699,7 @@ pub struct GraphSubjectLookup { #[serde( rename = "lookupKeys", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub lookup_keys: Vec, @@ -736,7 +736,7 @@ pub struct GraphSubjectQuery { #[serde( rename = "subjectKind", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub subject_kind: Vec, @@ -788,7 +788,7 @@ pub struct GraphUserList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -903,7 +903,7 @@ impl IdentityMapping { pub struct IdentityMappings { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mappings: Vec, @@ -1022,7 +1022,7 @@ pub struct PagedGraphGroups { #[serde( rename = "continuationToken", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub continuation_token: Vec, @@ -1030,7 +1030,7 @@ pub struct PagedGraphGroups { #[serde( rename = "graphGroups", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub graph_groups: Vec, @@ -1046,7 +1046,7 @@ pub struct PagedGraphMembers { #[serde( rename = "continuationToken", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub continuation_token: Vec, @@ -1054,7 +1054,7 @@ pub struct PagedGraphMembers { #[serde( rename = "graphMembers", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub graph_members: Vec, @@ -1070,7 +1070,7 @@ pub struct PagedGraphServicePrincipals { #[serde( rename = "continuationToken", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub continuation_token: Vec, @@ -1078,7 +1078,7 @@ pub struct PagedGraphServicePrincipals { #[serde( rename = "graphServicePrincipals", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub graph_service_principals: Vec, @@ -1094,7 +1094,7 @@ pub struct PagedGraphUsers { #[serde( rename = "continuationToken", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub continuation_token: Vec, @@ -1102,7 +1102,7 @@ pub struct PagedGraphUsers { #[serde( rename = "graphUsers", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub graph_users: Vec, @@ -1159,7 +1159,7 @@ pub struct ResolveDisconnectedUsersResponse { #[serde( rename = "mappingResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mapping_results: Vec, diff --git a/azure_devops_rust_api/src/headers.rs b/azure_devops_rust_api/src/headers.rs index 473f2125..0e3d2883 100644 --- a/azure_devops_rust_api/src/headers.rs +++ b/azure_devops_rust_api/src/headers.rs @@ -5,7 +5,7 @@ //! //! For more information see [Azure DevOps Rate and usage limits](https://learn.microsoft.com/en-us/azure/devops/integrate/concepts/rate-limits?view=azure-devops). -use azure_core::headers::HeaderName; +use azure_core::http::headers::HeaderName; /// A custom header indicating the service and type of threshold that was reached. Threshold types and service names might vary over time and without warning. /// We recommend displaying this string to a human, but not relying on it for computation. diff --git a/azure_devops_rust_api/src/hooks/mod.rs b/azure_devops_rust_api/src/hooks/mod.rs index eb95858b..c6baacb1 100644 --- a/azure_devops_rust_api/src/hooks/mod.rs +++ b/azure_devops_rust_api/src/hooks/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -226,37 +227,15 @@ pub mod consumers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ConsumerList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -294,38 +273,44 @@ pub mod consumers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(publisher_id) = &this.publisher_id { req.url_mut() .query_pairs_mut() .append_pair("publisherId", publisher_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/consumers", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -350,37 +335,15 @@ pub mod consumers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Consumer = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -419,28 +382,32 @@ pub mod consumers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(publisher_id) = &this.publisher_id { req.url_mut() .query_pairs_mut() .append_pair("publisherId", publisher_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/consumers/{}", self.client.endpoint(), &self.organization, @@ -448,10 +415,12 @@ pub mod consumers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -476,38 +445,15 @@ pub mod consumers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ConsumerActionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -546,28 +492,32 @@ pub mod consumers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(publisher_id) = &this.publisher_id { req.url_mut() .query_pairs_mut() .append_pair("publisherId", publisher_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/consumers/{}/actions", self.client.endpoint(), &self.organization, @@ -575,10 +525,12 @@ pub mod consumers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -603,37 +555,15 @@ pub mod consumers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ConsumerAction = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -673,28 +603,32 @@ pub mod consumers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(publisher_id) = &this.publisher_id { req.url_mut() .query_pairs_mut() .append_pair("publisherId", publisher_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/consumers/{}/actions/{}", self.client.endpoint(), &self.organization, @@ -703,10 +637,12 @@ pub mod consumers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -809,38 +745,15 @@ pub mod notifications { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::NotificationsQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -874,34 +787,40 @@ pub mod notifications { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/notificationsquery", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -926,38 +845,15 @@ pub mod notifications { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::NotificationList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1009,14 +905,18 @@ pub mod notifications { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(max_results) = &this.max_results { req.url_mut() @@ -1033,14 +933,14 @@ pub mod notifications { .query_pairs_mut() .append_pair("result", result); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/subscriptions/{}/notifications", self.client.endpoint(), &self.organization, @@ -1048,10 +948,12 @@ pub mod notifications { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1076,37 +978,15 @@ pub mod notifications { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Notification = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1141,23 +1021,27 @@ pub mod notifications { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/subscriptions/{}/notifications/{}", self.client.endpoint(), &self.organization, @@ -1166,10 +1050,12 @@ pub mod notifications { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1194,37 +1080,15 @@ pub mod notifications { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Notification = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1264,39 +1128,45 @@ pub mod notifications { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(use_real_data) = &this.use_real_data { req.url_mut() .query_pairs_mut() .append_pair("useRealData", &use_real_data.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/testnotifications", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1421,37 +1291,15 @@ pub mod publishers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PublisherList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1484,33 +1332,39 @@ pub mod publishers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/publishers", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1535,37 +1389,15 @@ pub mod publishers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Publisher = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1599,23 +1431,27 @@ pub mod publishers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/publishers/{}", self.client.endpoint(), &self.organization, @@ -1623,10 +1459,12 @@ pub mod publishers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1651,38 +1489,18 @@ pub mod publishers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::EventTypeDescriptorList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EventTypeDescriptorList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1716,23 +1534,27 @@ pub mod publishers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/publishers/{}/eventtypes", self.client.endpoint(), &self.organization, @@ -1740,10 +1562,12 @@ pub mod publishers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1769,38 +1593,15 @@ pub mod publishers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EventTypeDescriptor = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1835,23 +1636,27 @@ pub mod publishers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/publishers/{}/eventtypes/{}", self.client.endpoint(), &self.organization, @@ -1860,10 +1665,12 @@ pub mod publishers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1888,38 +1695,15 @@ pub mod publishers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::InputValuesQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1954,24 +1738,28 @@ pub mod publishers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/publishers/{}/inputValuesQuery", self.client.endpoint(), &self.organization, @@ -1979,10 +1767,12 @@ pub mod publishers { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2007,38 +1797,15 @@ pub mod publishers { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PublishersQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2072,34 +1839,40 @@ pub mod publishers { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/publishersquery", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2228,38 +2001,15 @@ pub mod subscriptions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2316,14 +2066,18 @@ pub mod subscriptions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(publisher_id) = &this.publisher_id { req.url_mut() @@ -2345,24 +2099,26 @@ pub mod subscriptions { .query_pairs_mut() .append_pair("consumerActionId", consumer_action_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/subscriptions", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2387,37 +2143,15 @@ pub mod subscriptions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Subscription = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2451,34 +2185,40 @@ pub mod subscriptions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/subscriptions", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2503,37 +2243,15 @@ pub mod subscriptions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Subscription = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2567,23 +2285,27 @@ pub mod subscriptions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/subscriptions/{}", self.client.endpoint(), &self.organization, @@ -2591,10 +2313,12 @@ pub mod subscriptions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2619,37 +2343,15 @@ pub mod subscriptions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Subscription = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2684,24 +2386,28 @@ pub mod subscriptions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/subscriptions/{}", self.client.endpoint(), &self.organization, @@ -2709,10 +2415,12 @@ pub mod subscriptions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2737,23 +2445,10 @@ pub mod subscriptions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2787,23 +2482,27 @@ pub mod subscriptions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/subscriptions/{}", self.client.endpoint(), &self.organization, @@ -2811,10 +2510,12 @@ pub mod subscriptions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2842,38 +2543,15 @@ pub mod subscriptions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionsQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2907,34 +2585,40 @@ pub mod subscriptions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/subscriptionsquery", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2997,38 +2681,18 @@ pub mod diagnostics { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::SubscriptionDiagnostics, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionDiagnostics = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3062,23 +2726,27 @@ pub mod diagnostics { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/subscriptions/{}/diagnostics", self.client.endpoint(), &self.organization, @@ -3086,10 +2754,12 @@ pub mod diagnostics { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3115,38 +2785,18 @@ pub mod diagnostics { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::SubscriptionDiagnostics, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionDiagnostics = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3181,24 +2831,28 @@ pub mod diagnostics { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/hooks/subscriptions/{}/diagnostics", self.client.endpoint(), &self.organization, @@ -3206,10 +2860,12 @@ pub mod diagnostics { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/hooks/models.rs b/azure_devops_rust_api/src/hooks/models.rs index 2b76c110..af5e2064 100644 --- a/azure_devops_rust_api/src/hooks/models.rs +++ b/azure_devops_rust_api/src/hooks/models.rs @@ -14,7 +14,7 @@ pub struct Consumer { #[doc = "Gets this consumer's actions."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub actions: Vec, @@ -52,7 +52,7 @@ pub struct Consumer { #[serde( rename = "inputDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_descriptors: Vec, @@ -111,7 +111,7 @@ pub struct ConsumerAction { #[serde( rename = "inputDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_descriptors: Vec, @@ -122,7 +122,7 @@ pub struct ConsumerAction { #[serde( rename = "supportedEventTypes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub supported_event_types: Vec, @@ -148,7 +148,7 @@ pub struct ConsumerActionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -164,7 +164,7 @@ pub struct ConsumerList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -251,7 +251,7 @@ pub struct EventTypeDescriptor { #[serde( rename = "inputDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_descriptors: Vec, @@ -269,7 +269,7 @@ pub struct EventTypeDescriptor { #[serde( rename = "supportedResourceVersions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub supported_resource_versions: Vec, @@ -288,7 +288,7 @@ pub struct EventTypeDescriptorList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -436,7 +436,7 @@ pub struct InputDescriptor { #[serde( rename = "dependencyInputIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dependency_input_ids: Vec, @@ -524,7 +524,7 @@ pub struct InputFilter { #[doc = "Groups of input filter expressions. This filter matches a set of inputs if any (one or more) of the groups evaluates to true."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub conditions: Vec, @@ -697,7 +697,7 @@ pub struct InputValues { #[serde( rename = "possibleValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub possible_values: Vec, @@ -731,7 +731,7 @@ pub struct InputValuesQuery { #[serde( rename = "inputValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_values: Vec, @@ -947,7 +947,7 @@ pub struct NotificationList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -997,7 +997,7 @@ pub struct NotificationSummary { #[doc = "The notification results for this particular subscription."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -1021,7 +1021,7 @@ pub struct NotificationsQuery { #[serde( rename = "associatedSubscriptions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub associated_subscriptions: Vec, @@ -1072,7 +1072,7 @@ pub struct NotificationsQuery { #[doc = "Results from the query"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -1090,14 +1090,14 @@ pub struct NotificationsQuery { #[serde( rename = "subscriptionIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub subscription_ids: Vec, #[doc = "Summary of notifications - the count of each result type (success, fail, ..)."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub summary: Vec, @@ -1150,7 +1150,7 @@ pub struct Publisher { #[serde( rename = "inputDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_descriptors: Vec, @@ -1168,7 +1168,7 @@ pub struct Publisher { #[serde( rename = "supportedEvents", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub supported_events: Vec, @@ -1208,7 +1208,7 @@ pub struct PublisherEvent { #[serde( rename = "otherResourceVersions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub other_resource_versions: Vec, @@ -1216,7 +1216,7 @@ pub struct PublisherEvent { #[serde( rename = "publisherInputFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub publisher_input_filters: Vec, @@ -1235,7 +1235,7 @@ pub struct PublisherList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1252,7 +1252,7 @@ pub struct PublishersQuery { #[serde( rename = "publisherIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub publisher_ids: Vec, @@ -1266,7 +1266,7 @@ pub struct PublishersQuery { #[doc = "Results from the query"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -1492,7 +1492,7 @@ pub struct SubscriptionInputValuesQuery { #[serde( rename = "inputValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_values: Vec, @@ -1525,7 +1525,7 @@ pub struct SubscriptionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1598,7 +1598,7 @@ pub struct SubscriptionsQuery { #[serde( rename = "consumerInputFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub consumer_input_filters: Vec, @@ -1616,14 +1616,14 @@ pub struct SubscriptionsQuery { #[serde( rename = "publisherInputFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub publisher_input_filters: Vec, #[doc = "Results from the query"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, diff --git a/azure_devops_rust_api/src/ims/mod.rs b/azure_devops_rust_api/src/ims/mod.rs index 3c505bbd..94a64d48 100644 --- a/azure_devops_rust_api/src/ims/mod.rs +++ b/azure_devops_rust_api/src/ims/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://vssps.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -168,37 +169,15 @@ pub mod identities { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -267,14 +246,18 @@ pub mod identities { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(descriptors) = &this.descriptors { req.url_mut() @@ -306,24 +289,26 @@ pub mod identities { .query_pairs_mut() .append_pair("queryMembership", query_membership); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/identities", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/ims/models.rs b/azure_devops_rust_api/src/ims/models.rs index c4690110..735db6a4 100644 --- a/azure_devops_rust_api/src/ims/models.rs +++ b/azure_devops_rust_api/src/ims/models.rs @@ -170,7 +170,7 @@ pub struct ChangedIdentities { #[doc = "Changed Identities"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub identities: Vec, @@ -363,20 +363,20 @@ pub struct IdentityBase { #[serde( rename = "memberIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub member_ids: Vec, #[serde( rename = "memberOf", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub member_of: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub members: Vec, @@ -431,14 +431,14 @@ impl IdentityBase { pub struct IdentityBatchInfo { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub descriptors: Vec, #[serde( rename = "identityIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub identity_ids: Vec, @@ -451,7 +451,7 @@ pub struct IdentityBatchInfo { #[serde( rename = "propertyNames", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub property_names: Vec, @@ -464,14 +464,14 @@ pub struct IdentityBatchInfo { #[serde( rename = "socialDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub social_descriptors: Vec, #[serde( rename = "subjectDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub subject_descriptors: Vec, @@ -522,7 +522,7 @@ pub struct IdentityList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -630,7 +630,7 @@ pub struct IdentitySelf { #[doc = "For AAD accounts this is all of the tenants that this account is a member of."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tenants: Vec, @@ -644,20 +644,20 @@ impl IdentitySelf { pub struct IdentitySnapshot { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub groups: Vec, #[serde( rename = "identityIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub identity_ids: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub memberships: Vec, @@ -665,7 +665,7 @@ pub struct IdentitySnapshot { pub scope_id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub scopes: Vec, @@ -782,13 +782,13 @@ pub struct PagedIdentities { #[serde( rename = "continuationToken", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub continuation_token: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub identities: Vec, @@ -809,14 +809,14 @@ pub struct PropertiesCollection { #[doc = "The set of keys in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub keys: Vec, #[doc = "The set of values in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -869,7 +869,7 @@ pub struct TenantInfo { #[serde( rename = "verifiedDomains", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub verified_domains: Vec, diff --git a/azure_devops_rust_api/src/member_entitlement_management/mod.rs b/azure_devops_rust_api/src/member_entitlement_management/mod.rs index 9f8112dc..d4933bc3 100644 --- a/azure_devops_rust_api/src/member_entitlement_management/mod.rs +++ b/azure_devops_rust_api/src/member_entitlement_management/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://vsaex.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -245,38 +246,15 @@ pub mod group_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GroupEntitlementList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -309,33 +287,39 @@ pub mod group_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/groupentitlements", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -360,40 +344,20 @@ pub mod group_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GroupEntitlementOperationReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GroupEntitlementOperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -433,39 +397,45 @@ pub mod group_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(rule_option) = &this.rule_option { req.url_mut() .query_pairs_mut() .append_pair("ruleOption", rule_option); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/groupentitlements", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -491,38 +461,15 @@ pub mod group_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GroupEntitlement = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -556,23 +503,27 @@ pub mod group_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/groupentitlements/{}", self.client.endpoint(), &self.organization, @@ -580,10 +531,12 @@ pub mod group_entitlements { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -608,40 +561,20 @@ pub mod group_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GroupEntitlementOperationReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GroupEntitlementOperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -682,29 +615,33 @@ pub mod group_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(rule_option) = &this.rule_option { req.url_mut() .query_pairs_mut() .append_pair("ruleOption", rule_option); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/groupentitlements/{}", self.client.endpoint(), &self.organization, @@ -712,10 +649,12 @@ pub mod group_entitlements { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -741,40 +680,20 @@ pub mod group_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::GroupEntitlementOperationReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GroupEntitlementOperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -820,14 +739,18 @@ pub mod group_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(rule_option) = &this.rule_option { req.url_mut() @@ -840,14 +763,14 @@ pub mod group_entitlements { &remove_group_membership.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/groupentitlements/{}", self.client.endpoint(), &self.organization, @@ -855,10 +778,12 @@ pub mod group_entitlements { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -950,38 +875,15 @@ pub mod members { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PagedGraphMemberList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1027,14 +929,18 @@ pub mod members { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(max_results) = &this.max_results { req.url_mut() @@ -1046,14 +952,14 @@ pub mod members { .query_pairs_mut() .append_pair("pagingToken", paging_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/GroupEntitlements/{}/members", self.client.endpoint(), &self.organization, @@ -1061,10 +967,12 @@ pub mod members { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1089,23 +997,10 @@ pub mod members { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1140,23 +1035,27 @@ pub mod members { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/GroupEntitlements/{}/members/{}", self.client.endpoint(), &self.organization, @@ -1165,10 +1064,12 @@ pub mod members { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1196,23 +1097,10 @@ pub mod members { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1247,23 +1135,27 @@ pub mod members { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/GroupEntitlements/{}/members/{}", self.client.endpoint(), &self.organization, @@ -1272,10 +1164,12 @@ pub mod members { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1328,37 +1222,15 @@ pub mod member_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, azure_core::http::JsonFormat>, + ); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1411,14 +1283,18 @@ pub mod member_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(continuation_token) = &this.continuation_token { req.url_mut() @@ -1440,24 +1316,26 @@ pub mod member_entitlements { .query_pairs_mut() .append_pair("$orderBy", order_by); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/memberentitlements", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1575,40 +1453,20 @@ pub mod service_principal_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ServicePrincipalEntitlementsPostResponse, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServicePrincipalEntitlementsPostResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1642,34 +1500,40 @@ pub mod service_principal_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/serviceprincipalentitlements", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1697,41 +1561,21 @@ pub mod service_principal_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ServicePrincipalEntitlementOperationReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServicePrincipalEntitlementOperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1765,34 +1609,40 @@ pub mod service_principal_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/serviceprincipalentitlements", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1820,40 +1670,20 @@ pub mod service_principal_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ServicePrincipalEntitlement, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServicePrincipalEntitlement = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1887,23 +1717,27 @@ pub mod service_principal_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/serviceprincipalentitlements/{}", self.client.endpoint(), &self.organization, @@ -1911,10 +1745,12 @@ pub mod service_principal_entitlements { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1940,40 +1776,20 @@ pub mod service_principal_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ServicePrincipalEntitlementsPatchResponse, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServicePrincipalEntitlementsPatchResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2008,24 +1824,28 @@ pub mod service_principal_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/serviceprincipalentitlements/{}", self.client.endpoint(), &self.organization, @@ -2033,10 +1853,12 @@ pub mod service_principal_entitlements { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2064,23 +1886,10 @@ pub mod service_principal_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2114,23 +1923,27 @@ pub mod service_principal_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/serviceprincipalentitlements/{}", self.client.endpoint(), &self.organization, @@ -2138,10 +1951,12 @@ pub mod service_principal_entitlements { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2280,38 +2095,18 @@ pub mod user_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PagedUserEntitlementsList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PagedUserEntitlementsList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2368,14 +2163,18 @@ pub mod user_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(continuation_token) = &this.continuation_token { req.url_mut() @@ -2397,24 +2196,26 @@ pub mod user_entitlements { .query_pairs_mut() .append_pair("$orderBy", order_by); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/userentitlements", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2440,40 +2241,20 @@ pub mod user_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::UserEntitlementsPostResponse, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UserEntitlementsPostResponse = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2507,34 +2288,40 @@ pub mod user_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/userentitlements", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2560,40 +2347,20 @@ pub mod user_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::UserEntitlementOperationReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UserEntitlementOperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2636,17 +2403,21 @@ pub mod user_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(do_not_send_invite_for_new_users) = &this.do_not_send_invite_for_new_users { @@ -2656,22 +2427,24 @@ pub mod user_entitlements { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/userentitlements", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2697,38 +2470,15 @@ pub mod user_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UserEntitlement = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2762,23 +2512,27 @@ pub mod user_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/userentitlements/{}", self.client.endpoint(), &self.organization, @@ -2786,10 +2540,12 @@ pub mod user_entitlements { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2814,40 +2570,20 @@ pub mod user_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::UserEntitlementsPatchResponse, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UserEntitlementsPatchResponse = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2882,24 +2618,28 @@ pub mod user_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/userentitlements/{}", self.client.endpoint(), &self.organization, @@ -2907,10 +2647,12 @@ pub mod user_entitlements { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2936,23 +2678,10 @@ pub mod user_entitlements { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2986,23 +2715,27 @@ pub mod user_entitlements { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/userentitlements/{}", self.client.endpoint(), &self.organization, @@ -3010,10 +2743,12 @@ pub mod user_entitlements { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3062,37 +2797,15 @@ pub mod user_entitlement_summary { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UsersSummary = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3131,38 +2844,44 @@ pub mod user_entitlement_summary { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(select) = &this.select { req.url_mut() .query_pairs_mut() .append_pair("select", select); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/userentitlementsummary", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/member_entitlement_management/models.rs b/azure_devops_rust_api/src/member_entitlement_management/models.rs index 4e43906a..6156831a 100644 --- a/azure_devops_rust_api/src/member_entitlement_management/models.rs +++ b/azure_devops_rust_api/src/member_entitlement_management/models.rs @@ -174,7 +174,7 @@ pub struct BaseOperationResult { #[doc = "List of error codes paired with their corresponding error messages"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub errors: Vec, @@ -208,7 +208,7 @@ pub struct EntitlementBase { #[serde( rename = "groupAssignments", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub group_assignments: Vec, @@ -227,7 +227,7 @@ pub struct EntitlementBase { #[serde( rename = "projectEntitlements", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub project_entitlements: Vec, @@ -242,7 +242,7 @@ pub struct EntitlementOperationResultBase { #[doc = "List of error codes paired with their corresponding error messages."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub errors: Vec, @@ -575,7 +575,7 @@ pub struct GroupEntitlement { #[doc = "Group members. Only used when creating a new group."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub members: Vec, @@ -583,7 +583,7 @@ pub struct GroupEntitlement { #[serde( rename = "projectEntitlements", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub project_entitlements: Vec, @@ -617,7 +617,7 @@ pub struct GroupEntitlementList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -644,7 +644,7 @@ pub struct GroupEntitlementOperationReference { #[doc = "List of results for each operation."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -895,7 +895,7 @@ pub struct MemberEntitlement2OperationReference { #[doc = "List of results for each operation."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -926,7 +926,7 @@ pub struct MemberEntitlement2PatchResponse { #[serde( rename = "operationResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub operation_results: Vec, @@ -987,7 +987,7 @@ pub struct MemberEntitlementOperationReference { #[doc = "List of results for each operation"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -1005,7 +1005,7 @@ pub struct MemberEntitlementsPatchResponse { #[serde( rename = "operationResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub operation_results: Vec, @@ -1094,7 +1094,7 @@ pub struct OperationResult { #[doc = "List of error codes paired with their corresponding error messages."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub errors: Vec, @@ -1124,13 +1124,13 @@ pub struct PagedGraphMemberList { pub continuation_token: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub items: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub members: Vec, @@ -1159,7 +1159,7 @@ pub struct PagedUserEntitlementsList { #[doc = "The requested user entitlement items."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub items: Vec, @@ -1207,7 +1207,7 @@ pub struct ProjectEntitlement { #[serde( rename = "teamRefs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub team_refs: Vec, @@ -1300,7 +1300,7 @@ pub struct ServicePrincipalEntitlementOperationReference { #[doc = "List of results for each operation."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -1334,7 +1334,7 @@ pub struct ServicePrincipalEntitlementsPatchResponse { #[serde( rename = "operationResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub operation_results: Vec, @@ -1445,7 +1445,7 @@ pub struct UserEntitlementOperationReference { #[doc = "List of results for each operation."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -1476,7 +1476,7 @@ pub struct UserEntitlementsPatchResponse { #[serde( rename = "operationResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub operation_results: Vec, @@ -1527,7 +1527,7 @@ pub struct UsersSummary { #[serde( rename = "availableAccessLevels", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub available_access_levels: Vec, @@ -1542,14 +1542,14 @@ pub struct UsersSummary { #[serde( rename = "groupOptions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub group_options: Vec, #[doc = "Summary of Licenses in the organization"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub licenses: Vec, @@ -1557,7 +1557,7 @@ pub struct UsersSummary { #[serde( rename = "projectRefs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub project_refs: Vec, diff --git a/azure_devops_rust_api/src/operations/mod.rs b/azure_devops_rust_api/src/operations/mod.rs index faeecf9c..fcb6218e 100644 --- a/azure_devops_rust_api/src/operations/mod.rs +++ b/azure_devops_rust_api/src/operations/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -166,37 +167,15 @@ pub mod operations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Operation = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -236,28 +215,32 @@ pub mod operations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(plugin_id) = &this.plugin_id { req.url_mut() .query_pairs_mut() .append_pair("pluginId", plugin_id); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/operations/{}", self.client.endpoint(), &self.organization, @@ -265,10 +248,12 @@ pub mod operations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/permissions_report/mod.rs b/azure_devops_rust_api/src/permissions_report/mod.rs index 2c01a9d5..b3b21a94 100644 --- a/azure_devops_rust_api/src/permissions_report/mod.rs +++ b/azure_devops_rust_api/src/permissions_report/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -194,38 +195,15 @@ pub mod permissions_report { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PermissionsReportList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -258,33 +236,39 @@ pub mod permissions_report { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/permissionsreport", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -309,37 +293,15 @@ pub mod permissions_report { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReferenceLinks = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -373,34 +335,40 @@ pub mod permissions_report { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/permissionsreport", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -425,38 +393,15 @@ pub mod permissions_report { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PermissionsReport = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -490,23 +435,27 @@ pub mod permissions_report { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/permissionsreport/{}", self.client.endpoint(), &self.organization, @@ -514,10 +463,12 @@ pub mod permissions_report { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -568,37 +519,13 @@ pub mod permissions_report_download { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -632,23 +559,27 @@ pub mod permissions_report_download { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/permissionsreport/{}/download", self.client.endpoint(), &self.organization, @@ -656,10 +587,12 @@ pub mod permissions_report_download { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/permissions_report/models.rs b/azure_devops_rust_api/src/permissions_report/models.rs index e64ade70..86ec8dd4 100644 --- a/azure_devops_rust_api/src/permissions_report/models.rs +++ b/azure_devops_rust_api/src/permissions_report/models.rs @@ -71,7 +71,7 @@ pub struct PermissionsReportList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -87,7 +87,7 @@ pub struct PermissionsReportRequest { #[doc = "List of groups and users to fetch permissions on. An empty list will fetch all groups and users in the organization"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub descriptors: Vec, @@ -101,7 +101,7 @@ pub struct PermissionsReportRequest { #[doc = "List of resources to fetch permisions on"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub resources: Vec, diff --git a/azure_devops_rust_api/src/pipelines/mod.rs b/azure_devops_rust_api/src/pipelines/mod.rs index 471f0922..374e84e6 100644 --- a/azure_devops_rust_api/src/pipelines/mod.rs +++ b/azure_devops_rust_api/src/pipelines/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -219,37 +220,15 @@ pub mod pipelines { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PipelineList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -301,14 +280,18 @@ pub mod pipelines { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(order_by) = &this.order_by { req.url_mut() @@ -325,14 +308,14 @@ pub mod pipelines { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines", self.client.endpoint(), &self.organization, @@ -340,10 +323,12 @@ pub mod pipelines { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -368,37 +353,15 @@ pub mod pipelines { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Pipeline = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -433,24 +396,28 @@ pub mod pipelines { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines", self.client.endpoint(), &self.organization, @@ -458,10 +425,12 @@ pub mod pipelines { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -486,37 +455,15 @@ pub mod pipelines { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Pipeline = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -557,28 +504,32 @@ pub mod pipelines { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(pipeline_version) = &this.pipeline_version { req.url_mut() .query_pairs_mut() .append_pair("pipelineVersion", &pipeline_version.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/{}", self.client.endpoint(), &self.organization, @@ -587,10 +538,12 @@ pub mod pipelines { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -648,37 +601,15 @@ pub mod preview { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PreviewRun = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -720,29 +651,33 @@ pub mod preview { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(pipeline_version) = &this.pipeline_version { req.url_mut() .query_pairs_mut() .append_pair("pipelineVersion", &pipeline_version.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/{}/preview", self.client.endpoint(), &self.organization, @@ -751,10 +686,12 @@ pub mod preview { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -853,37 +790,15 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RunList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -918,23 +833,27 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/{}/runs", self.client.endpoint(), &self.organization, @@ -943,10 +862,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -971,37 +892,13 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Run = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1043,29 +940,33 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(pipeline_version) = &this.pipeline_version { req.url_mut() .query_pairs_mut() .append_pair("pipelineVersion", &pipeline_version.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/{}/runs", self.client.endpoint(), &self.organization, @@ -1074,10 +975,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1102,37 +1005,13 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Run = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1168,23 +1047,27 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/{}/runs/{}", self.client.endpoint(), &self.organization, @@ -1194,10 +1077,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1258,37 +1143,15 @@ pub mod artifacts { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Artifact = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1331,14 +1194,18 @@ pub mod artifacts { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let artifact_name = &this.artifact_name; req.url_mut() @@ -1349,14 +1216,14 @@ pub mod artifacts { .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/{}/runs/{}/artifacts", self.client.endpoint(), &self.organization, @@ -1366,10 +1233,12 @@ pub mod artifacts { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1453,37 +1322,15 @@ pub mod logs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LogCollection = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1525,28 +1372,32 @@ pub mod logs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/{}/runs/{}/logs", self.client.endpoint(), &self.organization, @@ -1556,10 +1407,12 @@ pub mod logs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1584,37 +1437,13 @@ pub mod logs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Log = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1657,28 +1486,32 @@ pub mod logs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/pipelines/{}/runs/{}/logs/{}", self.client.endpoint(), &self.organization, @@ -1689,10 +1522,12 @@ pub mod logs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/pipelines/models.rs b/azure_devops_rust_api/src/pipelines/models.rs index afbc13fd..311ee99a 100644 --- a/azure_devops_rust_api/src/pipelines/models.rs +++ b/azure_devops_rust_api/src/pipelines/models.rs @@ -53,13 +53,13 @@ pub struct Container { pub options: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ports: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub volumes: Vec, @@ -192,7 +192,7 @@ pub struct LogCollection { #[doc = "The list of logs."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub logs: Vec, @@ -336,7 +336,7 @@ pub struct PipelineList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -559,7 +559,7 @@ pub struct RunList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -584,7 +584,7 @@ pub struct RunPipelineParameters { #[serde( rename = "stagesToSkip", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub stages_to_skip: Vec, diff --git a/azure_devops_rust_api/src/policy/mod.rs b/azure_devops_rust_api/src/policy/mod.rs index aa04c3b5..c03cf33f 100644 --- a/azure_devops_rust_api/src/policy/mod.rs +++ b/azure_devops_rust_api/src/policy/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -257,38 +258,18 @@ pub mod configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PolicyConfigurationList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfigurationList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -346,14 +327,18 @@ pub mod configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(scope) = &this.scope { req.url_mut().query_pairs_mut().append_pair("scope", scope); @@ -373,14 +358,14 @@ pub mod configurations { .query_pairs_mut() .append_pair("policyType", policy_type); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/policy/configurations", self.client.endpoint(), &self.organization, @@ -388,10 +373,12 @@ pub mod configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -417,38 +404,15 @@ pub mod configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -483,24 +447,28 @@ pub mod configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/policy/configurations", self.client.endpoint(), &self.organization, @@ -508,10 +476,12 @@ pub mod configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -536,38 +506,15 @@ pub mod configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -602,23 +549,27 @@ pub mod configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/policy/configurations/{}", self.client.endpoint(), &self.organization, @@ -627,10 +578,12 @@ pub mod configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -655,38 +608,15 @@ pub mod configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -722,24 +652,28 @@ pub mod configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/policy/configurations/{}", self.client.endpoint(), &self.organization, @@ -748,10 +682,12 @@ pub mod configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -776,23 +712,10 @@ pub mod configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -827,23 +750,27 @@ pub mod configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/policy/configurations/{}", self.client.endpoint(), &self.organization, @@ -852,10 +779,12 @@ pub mod configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -936,38 +865,18 @@ pub mod revisions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PolicyConfigurationList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfigurationList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1014,14 +923,18 @@ pub mod revisions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -1033,14 +946,14 @@ pub mod revisions { .query_pairs_mut() .append_pair("$skip", &skip.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/policy/configurations/{}/revisions", self.client.endpoint(), &self.organization, @@ -1049,10 +962,12 @@ pub mod revisions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1078,38 +993,15 @@ pub mod revisions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1145,23 +1037,27 @@ pub mod revisions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/policy/configurations/{}/revisions/{}", self.client.endpoint(), &self.organization, @@ -1171,10 +1067,12 @@ pub mod revisions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1269,38 +1167,18 @@ pub mod evaluations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PolicyEvaluationRecordList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyEvaluationRecordList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1353,14 +1231,18 @@ pub mod evaluations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let artifact_id = &this.artifact_id; req.url_mut() @@ -1382,14 +1264,14 @@ pub mod evaluations { .query_pairs_mut() .append_pair("$skip", &skip.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/policy/evaluations", self.client.endpoint(), &self.organization, @@ -1397,10 +1279,12 @@ pub mod evaluations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1426,38 +1310,18 @@ pub mod evaluations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PolicyEvaluationRecord, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyEvaluationRecord = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1492,23 +1356,27 @@ pub mod evaluations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/policy/evaluations/{}", self.client.endpoint(), &self.organization, @@ -1517,10 +1385,12 @@ pub mod evaluations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1546,38 +1416,18 @@ pub mod evaluations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PolicyEvaluationRecord, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyEvaluationRecord = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1612,23 +1462,27 @@ pub mod evaluations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/policy/evaluations/{}", self.client.endpoint(), &self.organization, @@ -1637,10 +1491,12 @@ pub mod evaluations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1711,37 +1567,15 @@ pub mod types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyTypeList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1775,23 +1609,27 @@ pub mod types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/policy/types", self.client.endpoint(), &self.organization, @@ -1799,10 +1637,12 @@ pub mod types { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1827,37 +1667,15 @@ pub mod types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyType = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1892,23 +1710,27 @@ pub mod types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/policy/types/{}", self.client.endpoint(), &self.organization, @@ -1917,10 +1739,12 @@ pub mod types { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/policy/models.rs b/azure_devops_rust_api/src/policy/models.rs index b9693d1b..138ce4ac 100644 --- a/azure_devops_rust_api/src/policy/models.rs +++ b/azure_devops_rust_api/src/policy/models.rs @@ -155,7 +155,7 @@ pub struct PolicyConfigurationList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -259,7 +259,7 @@ pub struct PolicyEvaluationRecordList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -299,7 +299,7 @@ pub struct PolicyTypeList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/processadmin/mod.rs b/azure_devops_rust_api/src/processadmin/mod.rs index 76f69a9a..f366ea91 100644 --- a/azure_devops_rust_api/src/processadmin/mod.rs +++ b/azure_devops_rust_api/src/processadmin/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -187,37 +188,15 @@ pub mod behaviors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AdminBehavior = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -252,27 +231,31 @@ pub mod behaviors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let behavior_ref_name = &this.behavior_ref_name; req.url_mut() .query_pairs_mut() .append_pair("behaviorRefName", behavior_ref_name); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processadmin/{}/behaviors?behaviorRefName={}", self.client.endpoint(), &self.organization, @@ -281,10 +264,12 @@ pub mod behaviors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -309,38 +294,15 @@ pub mod behaviors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AdminBehaviorList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -374,23 +336,27 @@ pub mod behaviors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processadmin/{}/behaviors", self.client.endpoint(), &self.organization, @@ -398,10 +364,12 @@ pub mod behaviors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -486,37 +454,13 @@ pub mod processes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -550,23 +494,27 @@ pub mod processes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processadmin/processes/export/{}", self.client.endpoint(), &self.organization, @@ -574,10 +522,12 @@ pub mod processes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -602,38 +552,15 @@ pub mod processes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessImportResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -679,17 +606,21 @@ pub mod processes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(ignore_warnings) = &this.ignore_warnings { req.url_mut() .query_pairs_mut() @@ -702,22 +633,24 @@ pub mod processes { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processadmin/processes/import", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -742,38 +675,15 @@ pub mod processes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessPromoteStatus = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -807,23 +717,27 @@ pub mod processes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processadmin/processes/status/{}", self.client.endpoint(), &self.organization, @@ -831,10 +745,12 @@ pub mod processes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/processadmin/models.rs b/azure_devops_rust_api/src/processadmin/models.rs index be026d68..3ab70bd2 100644 --- a/azure_devops_rust_api/src/processadmin/models.rs +++ b/azure_devops_rust_api/src/processadmin/models.rs @@ -23,7 +23,7 @@ pub struct AdminBehavior { #[doc = "List of behavior fields."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub fields: Vec, @@ -76,7 +76,7 @@ pub struct AdminBehaviorList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -153,7 +153,7 @@ pub struct ProcessImportResult { #[serde( rename = "validationResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub validation_results: Vec, diff --git a/azure_devops_rust_api/src/processes/mod.rs b/azure_devops_rust_api/src/processes/mod.rs index ce147db6..d217f83f 100644 --- a/azure_devops_rust_api/src/processes/mod.rs +++ b/azure_devops_rust_api/src/processes/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -343,37 +344,15 @@ pub mod groups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Group = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -414,17 +393,21 @@ pub mod groups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let remove_from_page_id = &this.remove_from_page_id; req.url_mut() .query_pairs_mut() @@ -434,18 +417,20 @@ pub mod groups { .query_pairs_mut() .append_pair("removeFromSectionId", remove_from_section_id); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}?removeFromPageId={}&removeFromSectionId={}" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id , & self . group_id , & self . remove_from_page_id , & self . remove_from_section_id)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}?removeFromPageId={}&removeFromSectionId={}" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id , & self . group_id , & self . remove_from_page_id , & self . remove_from_section_id)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -470,37 +455,15 @@ pub mod groups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Group = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -538,30 +501,36 @@ pub mod groups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -586,37 +555,15 @@ pub mod groups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Group = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -656,34 +603,40 @@ pub mod groups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let remove_from_section_id = &this.remove_from_section_id; req.url_mut() .query_pairs_mut() .append_pair("removeFromSectionId", remove_from_section_id); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id , & self . group_id)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id , & self . group_id)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -708,37 +661,15 @@ pub mod groups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Group = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -777,30 +708,36 @@ pub mod groups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id , & self . group_id)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id , & self . group_id)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -825,23 +762,10 @@ pub mod groups { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -879,29 +803,35 @@ pub mod groups { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id , & self . group_id)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id , & self . group_id)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1014,38 +944,15 @@ pub mod processes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessInfoList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1083,38 +990,44 @@ pub mod processes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1139,37 +1052,15 @@ pub mod processes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessInfo = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1203,34 +1094,40 @@ pub mod processes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1255,37 +1152,15 @@ pub mod processes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessInfo = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1324,28 +1199,32 @@ pub mod processes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}", self.client.endpoint(), &self.organization, @@ -1353,10 +1232,12 @@ pub mod processes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1381,37 +1262,15 @@ pub mod processes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessInfo = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1446,24 +1305,28 @@ pub mod processes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}", self.client.endpoint(), &self.organization, @@ -1471,10 +1334,12 @@ pub mod processes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1499,23 +1364,10 @@ pub mod processes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1549,23 +1401,27 @@ pub mod processes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}", self.client.endpoint(), &self.organization, @@ -1573,10 +1429,12 @@ pub mod processes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1709,38 +1567,15 @@ pub mod behaviors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessBehaviorList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1779,28 +1614,32 @@ pub mod behaviors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/behaviors", self.client.endpoint(), &self.organization, @@ -1808,10 +1647,12 @@ pub mod behaviors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1836,38 +1677,15 @@ pub mod behaviors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1902,24 +1720,28 @@ pub mod behaviors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/behaviors", self.client.endpoint(), &self.organization, @@ -1927,10 +1749,12 @@ pub mod behaviors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1955,38 +1779,15 @@ pub mod behaviors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2026,28 +1827,32 @@ pub mod behaviors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/behaviors/{}", self.client.endpoint(), &self.organization, @@ -2056,10 +1861,12 @@ pub mod behaviors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2084,38 +1891,15 @@ pub mod behaviors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2151,24 +1935,28 @@ pub mod behaviors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/behaviors/{}", self.client.endpoint(), &self.organization, @@ -2177,10 +1965,12 @@ pub mod behaviors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2205,23 +1995,10 @@ pub mod behaviors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2256,23 +2033,27 @@ pub mod behaviors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/behaviors/{}", self.client.endpoint(), &self.organization, @@ -2281,10 +2062,12 @@ pub mod behaviors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2417,38 +2200,18 @@ pub mod work_item_types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ProcessWorkItemTypeList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemTypeList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2488,28 +2251,32 @@ pub mod work_item_types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workitemtypes", self.client.endpoint(), &self.organization, @@ -2517,10 +2284,12 @@ pub mod work_item_types { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2546,38 +2315,15 @@ pub mod work_item_types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemType = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2612,24 +2358,28 @@ pub mod work_item_types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workitemtypes", self.client.endpoint(), &self.organization, @@ -2637,10 +2387,12 @@ pub mod work_item_types { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2665,38 +2417,15 @@ pub mod work_item_types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemType = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2737,28 +2466,32 @@ pub mod work_item_types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workitemtypes/{}", self.client.endpoint(), &self.organization, @@ -2767,10 +2500,12 @@ pub mod work_item_types { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2795,38 +2530,15 @@ pub mod work_item_types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemType = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2862,24 +2574,28 @@ pub mod work_item_types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workitemtypes/{}", self.client.endpoint(), &self.organization, @@ -2888,10 +2604,12 @@ pub mod work_item_types { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2916,23 +2634,10 @@ pub mod work_item_types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2967,23 +2672,27 @@ pub mod work_item_types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workitemtypes/{}", self.client.endpoint(), &self.organization, @@ -2992,10 +2701,12 @@ pub mod work_item_types { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3142,40 +2853,20 @@ pub mod fields { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ProcessWorkItemTypeFieldList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemTypeFieldList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3210,23 +2901,27 @@ pub mod fields { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields", self.client.endpoint(), &self.organization, @@ -3235,10 +2930,12 @@ pub mod fields { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3264,38 +2961,18 @@ pub mod fields { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ProcessWorkItemTypeField, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemTypeField = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3331,24 +3008,28 @@ pub mod fields { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields", self.client.endpoint(), &self.organization, @@ -3357,10 +3038,12 @@ pub mod fields { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3386,38 +3069,18 @@ pub mod fields { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ProcessWorkItemTypeField, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemTypeField = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3458,28 +3121,32 @@ pub mod fields { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", self.client.endpoint(), &self.organization, @@ -3489,10 +3156,12 @@ pub mod fields { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3518,38 +3187,18 @@ pub mod fields { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ProcessWorkItemTypeField, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemTypeField = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3586,24 +3235,28 @@ pub mod fields { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", self.client.endpoint(), &self.organization, @@ -3613,10 +3266,12 @@ pub mod fields { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3642,23 +3297,10 @@ pub mod fields { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3694,23 +3336,27 @@ pub mod fields { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", self.client.endpoint(), &self.organization, @@ -3720,10 +3366,12 @@ pub mod fields { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3780,37 +3428,15 @@ pub mod layout { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FormLayout = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3845,23 +3471,27 @@ pub mod layout { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout", self.client.endpoint(), &self.organization, @@ -3870,10 +3500,12 @@ pub mod layout { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4015,37 +3647,15 @@ pub mod controls { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Control = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4082,24 +3692,28 @@ pub mod controls { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls", self.client.endpoint(), &self.organization, @@ -4109,10 +3723,12 @@ pub mod controls { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4137,37 +3753,15 @@ pub mod controls { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Control = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4211,29 +3805,33 @@ pub mod controls { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(remove_from_group_id) = &this.remove_from_group_id { req.url_mut() .query_pairs_mut() .append_pair("removeFromGroupId", remove_from_group_id); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls/{}", self.client.endpoint(), &self.organization, @@ -4244,10 +3842,12 @@ pub mod controls { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4272,37 +3872,15 @@ pub mod controls { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Control = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4340,24 +3918,28 @@ pub mod controls { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls/{}", self.client.endpoint(), &self.organization, @@ -4368,10 +3950,12 @@ pub mod controls { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4396,23 +3980,10 @@ pub mod controls { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4449,23 +4020,27 @@ pub mod controls { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls/{}", self.client.endpoint(), &self.organization, @@ -4476,10 +4051,12 @@ pub mod controls { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4583,37 +4160,13 @@ pub mod pages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Page = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4649,24 +4202,28 @@ pub mod pages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages", self.client.endpoint(), &self.organization, @@ -4675,10 +4232,12 @@ pub mod pages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4703,37 +4262,13 @@ pub mod pages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Page = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4769,24 +4304,28 @@ pub mod pages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages", self.client.endpoint(), &self.organization, @@ -4795,10 +4334,12 @@ pub mod pages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4823,23 +4364,10 @@ pub mod pages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4875,23 +4403,27 @@ pub mod pages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}", self.client.endpoint(), &self.organization, @@ -4901,10 +4433,12 @@ pub mod pages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5007,37 +4541,15 @@ pub mod system_controls { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ControlList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5072,23 +4584,27 @@ pub mod system_controls { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols", self.client.endpoint(), &self.organization, @@ -5097,10 +4613,12 @@ pub mod system_controls { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5125,37 +4643,15 @@ pub mod system_controls { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Control = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5192,24 +4688,28 @@ pub mod system_controls { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols/{}", self.client.endpoint(), &self.organization, @@ -5219,10 +4719,12 @@ pub mod system_controls { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5247,37 +4749,15 @@ pub mod system_controls { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ControlList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5313,23 +4793,27 @@ pub mod system_controls { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols/{}", self.client.endpoint(), &self.organization, @@ -5339,10 +4823,12 @@ pub mod system_controls { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5485,38 +4971,15 @@ pub mod rules { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessRuleList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5551,23 +5014,27 @@ pub mod rules { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules", self.client.endpoint(), &self.organization, @@ -5576,10 +5043,12 @@ pub mod rules { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5604,37 +5073,15 @@ pub mod rules { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessRule = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5670,24 +5117,28 @@ pub mod rules { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules", self.client.endpoint(), &self.organization, @@ -5696,10 +5147,12 @@ pub mod rules { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5724,37 +5177,15 @@ pub mod rules { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessRule = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5790,23 +5221,27 @@ pub mod rules { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", self.client.endpoint(), &self.organization, @@ -5816,10 +5251,12 @@ pub mod rules { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5844,37 +5281,15 @@ pub mod rules { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessRule = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5911,24 +5326,28 @@ pub mod rules { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", self.client.endpoint(), &self.organization, @@ -5938,10 +5357,12 @@ pub mod rules { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5966,23 +5387,10 @@ pub mod rules { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6018,23 +5426,27 @@ pub mod rules { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", self.client.endpoint(), &self.organization, @@ -6044,10 +5456,12 @@ pub mod rules { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6217,40 +5631,20 @@ pub mod states { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemStateResultModelList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemStateResultModelList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6285,23 +5679,27 @@ pub mod states { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states", self.client.endpoint(), &self.organization, @@ -6310,10 +5708,12 @@ pub mod states { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6339,38 +5739,18 @@ pub mod states { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemStateResultModel, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemStateResultModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6406,24 +5786,28 @@ pub mod states { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states", self.client.endpoint(), &self.organization, @@ -6432,10 +5816,12 @@ pub mod states { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6461,38 +5847,18 @@ pub mod states { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemStateResultModel, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemStateResultModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6528,23 +5894,27 @@ pub mod states { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", self.client.endpoint(), &self.organization, @@ -6554,10 +5924,12 @@ pub mod states { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6583,38 +5955,18 @@ pub mod states { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemStateResultModel, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemStateResultModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6651,24 +6003,28 @@ pub mod states { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", self.client.endpoint(), &self.organization, @@ -6678,10 +6034,12 @@ pub mod states { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6707,38 +6065,18 @@ pub mod states { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemStateResultModel, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemStateResultModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6775,24 +6113,28 @@ pub mod states { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", self.client.endpoint(), &self.organization, @@ -6802,10 +6144,12 @@ pub mod states { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6831,23 +6175,10 @@ pub mod states { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6883,23 +6214,27 @@ pub mod states { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", self.client.endpoint(), &self.organization, @@ -6909,10 +6244,12 @@ pub mod states { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7055,38 +6392,18 @@ pub mod work_item_types_behaviors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemTypeBehaviorList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeBehaviorList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7121,23 +6438,27 @@ pub mod work_item_types_behaviors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", self.client.endpoint(), &self.organization, @@ -7146,10 +6467,12 @@ pub mod work_item_types_behaviors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7175,38 +6498,15 @@ pub mod work_item_types_behaviors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7242,24 +6542,28 @@ pub mod work_item_types_behaviors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", self.client.endpoint(), &self.organization, @@ -7268,10 +6572,12 @@ pub mod work_item_types_behaviors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7296,38 +6602,15 @@ pub mod work_item_types_behaviors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7363,24 +6646,28 @@ pub mod work_item_types_behaviors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", self.client.endpoint(), &self.organization, @@ -7389,10 +6676,12 @@ pub mod work_item_types_behaviors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7417,38 +6706,15 @@ pub mod work_item_types_behaviors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7484,23 +6750,27 @@ pub mod work_item_types_behaviors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors/{}", self.client.endpoint(), &self.organization, @@ -7510,10 +6780,12 @@ pub mod work_item_types_behaviors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7538,23 +6810,10 @@ pub mod work_item_types_behaviors { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7590,23 +6849,27 @@ pub mod work_item_types_behaviors { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors/{}", self.client.endpoint(), &self.organization, @@ -7616,10 +6879,12 @@ pub mod work_item_types_behaviors { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7733,38 +6998,15 @@ pub mod lists { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PickListMetadataList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7797,33 +7039,39 @@ pub mod lists { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/lists", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7848,37 +7096,15 @@ pub mod lists { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PickList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7912,34 +7138,40 @@ pub mod lists { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/lists", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7964,37 +7196,15 @@ pub mod lists { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PickList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8028,23 +7238,27 @@ pub mod lists { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/lists/{}", self.client.endpoint(), &self.organization, @@ -8052,10 +7266,12 @@ pub mod lists { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8080,37 +7296,15 @@ pub mod lists { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PickList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8145,24 +7339,28 @@ pub mod lists { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/lists/{}", self.client.endpoint(), &self.organization, @@ -8170,10 +7368,12 @@ pub mod lists { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8198,23 +7398,10 @@ pub mod lists { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8248,23 +7435,27 @@ pub mod lists { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/processes/lists/{}", self.client.endpoint(), &self.organization, @@ -8272,10 +7463,12 @@ pub mod lists { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/processes/models.rs b/azure_devops_rust_api/src/processes/models.rs index 0abb2c57..cbaf2b4e 100644 --- a/azure_devops_rust_api/src/processes/models.rs +++ b/azure_devops_rust_api/src/processes/models.rs @@ -12,7 +12,7 @@ pub struct AddProcessWorkItemTypeFieldRequest { #[serde( rename = "allowedValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub allowed_values: Vec, @@ -111,7 +111,7 @@ pub struct ControlList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -156,14 +156,14 @@ pub struct CreateProcessRuleRequest { #[doc = "List of actions to take when the rule is triggered."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub actions: Vec, #[doc = "List of conditions when the rule should be triggered."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub conditions: Vec, @@ -294,13 +294,13 @@ pub mod field_model { pub struct FieldRuleModel { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub actions: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub conditions: Vec, @@ -332,14 +332,14 @@ pub struct FormLayout { #[doc = "Gets and sets extensions list."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub extensions: Vec, #[doc = "Top level tabs of the layout."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub pages: Vec, @@ -347,7 +347,7 @@ pub struct FormLayout { #[serde( rename = "systemControls", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub system_controls: Vec, @@ -366,7 +366,7 @@ pub struct Group { #[doc = "Controls to be put in the group."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub controls: Vec, @@ -453,7 +453,7 @@ pub struct Page { #[doc = "The sections of the page."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub sections: Vec
, @@ -489,7 +489,7 @@ pub struct PickList { #[doc = "A list of PicklistItemModel."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub items: Vec, @@ -533,7 +533,7 @@ pub struct PickListMetadataList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -558,7 +558,7 @@ pub struct ProcessBehavior { #[doc = "Process Behavior Fields."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub fields: Vec, @@ -653,7 +653,7 @@ pub struct ProcessBehaviorList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -729,7 +729,7 @@ pub struct ProcessInfo { #[doc = "Projects in this process to which the user is subscribed to."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub projects: Vec, @@ -768,7 +768,7 @@ pub struct ProcessInfoList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -789,7 +789,7 @@ pub struct ProcessModel { #[doc = "Projects in this process"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub projects: Vec, @@ -896,7 +896,7 @@ pub struct ProcessRuleList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -911,7 +911,7 @@ impl ProcessRuleList { pub struct ProcessWorkItemType { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub behaviors: Vec, @@ -952,7 +952,7 @@ pub struct ProcessWorkItemType { pub reference_name: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub states: Vec, @@ -985,7 +985,7 @@ pub struct ProcessWorkItemTypeField { #[serde( rename = "allowedValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub allowed_values: Vec, @@ -1091,7 +1091,7 @@ pub struct ProcessWorkItemTypeFieldList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1107,7 +1107,7 @@ pub struct ProcessWorkItemTypeList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1301,7 +1301,7 @@ pub struct Section { #[doc = "List of child groups in this section"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub groups: Vec, @@ -1359,7 +1359,7 @@ pub struct UpdateProcessWorkItemTypeFieldRequest { #[serde( rename = "allowedValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub allowed_values: Vec, @@ -1478,7 +1478,7 @@ pub struct WorkItemBehavior { pub description: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub fields: Vec, @@ -1619,7 +1619,7 @@ pub struct WorkItemStateResultModelList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1660,7 +1660,7 @@ pub struct WorkItemTypeBehaviorList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1674,7 +1674,7 @@ impl WorkItemTypeBehaviorList { pub struct WorkItemTypeModel { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub behaviors: Vec, @@ -1704,7 +1704,7 @@ pub struct WorkItemTypeModel { pub name: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub states: Vec, diff --git a/azure_devops_rust_api/src/profile/mod.rs b/azure_devops_rust_api/src/profile/mod.rs index 9ba0bf3a..bac4991f 100644 --- a/azure_devops_rust_api/src/profile/mod.rs +++ b/azure_devops_rust_api/src/profile/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://app.vssps.visualstudio.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -164,37 +165,15 @@ pub mod profiles { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Profile = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -257,14 +236,18 @@ pub mod profiles { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(details) = &this.details { req.url_mut() @@ -291,24 +274,26 @@ pub mod profiles { .query_pairs_mut() .append_pair("forceRefresh", &force_refresh.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/_apis/profile/profiles/{}", self.client.endpoint(), &self.id ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/profile/models.rs b/azure_devops_rust_api/src/profile/models.rs index 20e679b1..c6c36200 100644 --- a/azure_devops_rust_api/src/profile/models.rs +++ b/azure_devops_rust_api/src/profile/models.rs @@ -69,7 +69,7 @@ pub struct Avatar { pub time_stamp: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -320,7 +320,7 @@ pub struct ProfileRegions { #[serde( rename = "noticeContactConsentRequirementRegions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub notice_contact_consent_requirement_regions: Vec, @@ -328,14 +328,14 @@ pub struct ProfileRegions { #[serde( rename = "optOutContactConsentRequirementRegions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub opt_out_contact_consent_requirement_regions: Vec, #[doc = "List of country/regions"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub regions: Vec, diff --git a/azure_devops_rust_api/src/release/mod.rs b/azure_devops_rust_api/src/release/mod.rs index a8690798..643eaaa9 100644 --- a/azure_devops_rust_api/src/release/mod.rs +++ b/azure_devops_rust_api/src/release/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://vsrm.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -412,37 +413,15 @@ pub mod releases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -501,14 +480,18 @@ pub mod releases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(approval_filters) = &this.approval_filters { req.url_mut() @@ -530,14 +513,14 @@ pub mod releases { .query_pairs_mut() .append_pair("$topGateRecords", &top_gate_records.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/releases/{}?", self.client.endpoint(), &self.organization, @@ -546,10 +529,12 @@ pub mod releases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -574,37 +559,15 @@ pub mod releases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -768,14 +731,18 @@ pub mod releases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(definition_id) = &this.definition_id { req.url_mut() @@ -810,14 +777,18 @@ pub mod releases { ); } if let Some(min_created_time) = &this.min_created_time { + let formatted_date_time = + crate::date_time::format_date_time(min_created_time)?; req.url_mut() .query_pairs_mut() - .append_pair("minCreatedTime", &min_created_time.to_string()); + .append_pair("minCreatedTime", &formatted_date_time); } if let Some(max_created_time) = &this.max_created_time { + let formatted_date_time = + crate::date_time::format_date_time(max_created_time)?; req.url_mut() .query_pairs_mut() - .append_pair("maxCreatedTime", &max_created_time.to_string()); + .append_pair("maxCreatedTime", &formatted_date_time); } if let Some(query_order) = &this.query_order { req.url_mut() @@ -882,14 +853,14 @@ pub mod releases { if let Some(path) = &this.path { req.url_mut().query_pairs_mut().append_pair("path", path); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/releases", self.client.endpoint(), &self.organization, @@ -897,10 +868,12 @@ pub mod releases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -925,37 +898,15 @@ pub mod releases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -990,24 +941,28 @@ pub mod releases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/releases", self.client.endpoint(), &self.organization, @@ -1015,10 +970,12 @@ pub mod releases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1043,37 +1000,13 @@ pub mod releases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1109,28 +1042,32 @@ pub mod releases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let definition_snapshot_revision = &this.definition_snapshot_revision; req.url_mut().query_pairs_mut().append_pair( "definitionSnapshotRevision", &definition_snapshot_revision.to_string(), ); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/releases/{}", self.client.endpoint(), &self.organization, @@ -1139,10 +1076,12 @@ pub mod releases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1167,37 +1106,15 @@ pub mod releases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1233,24 +1150,28 @@ pub mod releases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/releases/{}", self.client.endpoint(), &self.organization, @@ -1259,10 +1180,12 @@ pub mod releases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1287,37 +1210,15 @@ pub mod releases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1353,24 +1254,28 @@ pub mod releases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/releases/{}", self.client.endpoint(), &self.organization, @@ -1379,10 +1284,12 @@ pub mod releases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1407,38 +1314,15 @@ pub mod releases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseEnvironment = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1480,28 +1364,32 @@ pub mod releases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/Release/releases/{}/environments/{}", self.client.endpoint(), &self.organization, @@ -1511,10 +1399,12 @@ pub mod releases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1539,38 +1429,15 @@ pub mod releases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseEnvironment = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1607,24 +1474,28 @@ pub mod releases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/Release/releases/{}/environments/{}", self.client.endpoint(), &self.organization, @@ -1634,10 +1505,12 @@ pub mod releases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1662,37 +1535,13 @@ pub mod releases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1742,14 +1591,18 @@ pub mod releases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(start_line) = &this.start_line { req.url_mut() @@ -1761,20 +1614,22 @@ pub mod releases { .query_pairs_mut() .append_pair("endLine", &end_line.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/deployPhases/{}/tasks/{}/logs" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . release_deploy_phase_id , & self . task_id)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/deployPhases/{}/tasks/{}/logs" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . release_deploy_phase_id , & self . task_id)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1799,37 +1654,13 @@ pub mod releases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1864,23 +1695,27 @@ pub mod releases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/releases/{}/logs", self.client.endpoint(), &self.organization, @@ -1889,10 +1724,12 @@ pub mod releases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1973,38 +1810,15 @@ pub mod approvals { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseApprovalList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2086,14 +1900,18 @@ pub mod approvals { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(assigned_to_filter) = &this.assigned_to_filter { req.url_mut() @@ -2136,14 +1954,14 @@ pub mod approvals { &include_my_group_approvals.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/approvals", self.client.endpoint(), &self.organization, @@ -2151,10 +1969,12 @@ pub mod approvals { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2179,38 +1999,15 @@ pub mod approvals { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseApproval = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2246,24 +2043,28 @@ pub mod approvals { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/approvals/{}", self.client.endpoint(), &self.organization, @@ -2272,10 +2073,12 @@ pub mod approvals { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2460,38 +2263,15 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseDefinitionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2612,14 +2392,18 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(search_text) = &this.search_text { req.url_mut() @@ -2692,14 +2476,14 @@ pub mod definitions { &search_text_contains_folder_name.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/definitions", self.client.endpoint(), &self.organization, @@ -2707,10 +2491,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2735,38 +2521,15 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2801,24 +2564,28 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/definitions", self.client.endpoint(), &self.organization, @@ -2826,10 +2593,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2854,38 +2623,15 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2920,24 +2666,28 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/definitions", self.client.endpoint(), &self.organization, @@ -2945,10 +2695,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2973,38 +2725,15 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3045,28 +2774,32 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(property_filters) = &this.property_filters { req.url_mut() .query_pairs_mut() .append_pair("propertyFilters", property_filters); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/definitions/{}", self.client.endpoint(), &self.organization, @@ -3075,10 +2808,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3103,23 +2838,10 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3166,14 +2888,18 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(comment) = &this.comment { req.url_mut() @@ -3185,14 +2911,14 @@ pub mod definitions { .query_pairs_mut() .append_pair("forceDelete", &force_delete.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/definitions/{}", self.client.endpoint(), &self.organization, @@ -3201,10 +2927,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3232,40 +2960,20 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ReleaseDefinitionRevisionList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseDefinitionRevisionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3300,23 +3008,27 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/Release/definitions/{}/revisions", self.client.endpoint(), &self.organization, @@ -3325,10 +3037,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3354,37 +3068,13 @@ pub mod definitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3420,23 +3110,27 @@ pub mod definitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/Release/definitions/{}/revisions/{}", self.client.endpoint(), &self.organization, @@ -3446,10 +3140,12 @@ pub mod definitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3513,37 +3209,15 @@ pub mod deployments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3664,14 +3338,18 @@ pub mod deployments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(definition_id) = &this.definition_id { req.url_mut() @@ -3690,14 +3368,18 @@ pub mod deployments { .append_pair("createdBy", created_by); } if let Some(min_modified_time) = &this.min_modified_time { + let formatted_date_time = + crate::date_time::format_date_time(min_modified_time)?; req.url_mut() .query_pairs_mut() - .append_pair("minModifiedTime", &min_modified_time.to_string()); + .append_pair("minModifiedTime", &formatted_date_time); } if let Some(max_modified_time) = &this.max_modified_time { + let formatted_date_time = + crate::date_time::format_date_time(max_modified_time)?; req.url_mut() .query_pairs_mut() - .append_pair("maxModifiedTime", &max_modified_time.to_string()); + .append_pair("maxModifiedTime", &formatted_date_time); } if let Some(deployment_status) = &this.deployment_status { req.url_mut() @@ -3736,28 +3418,32 @@ pub mod deployments { .append_pair("createdFor", created_for); } if let Some(min_started_time) = &this.min_started_time { + let formatted_date_time = + crate::date_time::format_date_time(min_started_time)?; req.url_mut() .query_pairs_mut() - .append_pair("minStartedTime", &min_started_time.to_string()); + .append_pair("minStartedTime", &formatted_date_time); } if let Some(max_started_time) = &this.max_started_time { + let formatted_date_time = + crate::date_time::format_date_time(max_started_time)?; req.url_mut() .query_pairs_mut() - .append_pair("maxStartedTime", &max_started_time.to_string()); + .append_pair("maxStartedTime", &formatted_date_time); } if let Some(source_branch) = &this.source_branch { req.url_mut() .query_pairs_mut() .append_pair("sourceBranch", source_branch); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/deployments", self.client.endpoint(), &self.organization, @@ -3765,10 +3451,12 @@ pub mod deployments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3886,37 +3574,15 @@ pub mod folders { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FolderList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3957,28 +3623,32 @@ pub mod folders { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(query_order) = &this.query_order { req.url_mut() .query_pairs_mut() .append_pair("queryOrder", query_order); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/folders/{}", self.client.endpoint(), &self.organization, @@ -3987,10 +3657,12 @@ pub mod folders { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4015,37 +3687,15 @@ pub mod folders { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4081,24 +3731,28 @@ pub mod folders { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/folders/{}", self.client.endpoint(), &self.organization, @@ -4107,10 +3761,12 @@ pub mod folders { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4135,37 +3791,15 @@ pub mod folders { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4201,24 +3835,28 @@ pub mod folders { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/folders/{}", self.client.endpoint(), &self.organization, @@ -4227,10 +3865,12 @@ pub mod folders { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4255,23 +3895,10 @@ pub mod folders { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4306,23 +3933,27 @@ pub mod folders { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/folders/{}", self.client.endpoint(), &self.organization, @@ -4331,10 +3962,12 @@ pub mod folders { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4394,37 +4027,15 @@ pub mod gates { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseGates = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4460,24 +4071,28 @@ pub mod gates { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/release/gates/{}", self.client.endpoint(), &self.organization, @@ -4486,10 +4101,12 @@ pub mod gates { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4663,38 +4280,18 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ReleaseTaskAttachmentList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseTaskAttachmentList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4733,29 +4330,35 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/plan/{}/attachments/{}" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . attempt_id , & self . plan_id , & self . type_)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/plan/{}/attachments/{}" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . attempt_id , & self . plan_id , & self . type_)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4781,37 +4384,13 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4853,29 +4432,35 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/plan/{}/timelines/{}/records/{}/attachments/{}/{}" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . attempt_id , & self . plan_id , & self . timeline_id , & self . record_id , & self . type_ , & self . name)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/plan/{}/timelines/{}/records/{}/attachments/{}/{}" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . attempt_id , & self . plan_id , & self . timeline_id , & self . record_id , & self . type_ , & self . name)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4900,38 +4485,18 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ReleaseTaskAttachmentList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseTaskAttachmentList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4970,29 +4535,35 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/timelines/{}/attachments/{}" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . attempt_id , & self . timeline_id , & self . type_)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/timelines/{}/attachments/{}" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . attempt_id , & self . timeline_id , & self . type_)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5018,37 +4589,13 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5089,29 +4636,35 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/timelines/{}/records/{}/attachments/{}/{}" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . attempt_id , & self . timeline_id , & self . record_id , & self . type_ , & self . name)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/timelines/{}/records/{}/attachments/{}/{}" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . attempt_id , & self . timeline_id , & self . record_id , & self . type_ , & self . name)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5212,38 +4765,18 @@ pub mod manual_interventions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ManualInterventionList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ManualInterventionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5278,23 +4811,27 @@ pub mod manual_interventions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/Release/releases/{}/manualinterventions", self.client.endpoint(), &self.organization, @@ -5303,10 +4840,12 @@ pub mod manual_interventions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5332,38 +4871,15 @@ pub mod manual_interventions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ManualIntervention = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5399,23 +4915,27 @@ pub mod manual_interventions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}", self.client.endpoint(), &self.organization, @@ -5425,10 +4945,12 @@ pub mod manual_interventions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5453,38 +4975,15 @@ pub mod manual_interventions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ManualIntervention = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5521,24 +5020,28 @@ pub mod manual_interventions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}", self.client.endpoint(), &self.organization, @@ -5548,10 +5051,12 @@ pub mod manual_interventions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/release/models.rs b/azure_devops_rust_api/src/release/models.rs index 497a080c..5b8b588a 100644 --- a/azure_devops_rust_api/src/release/models.rs +++ b/azure_devops_rust_api/src/release/models.rs @@ -252,7 +252,7 @@ pub struct ArtifactContributionDefinition { #[serde( rename = "dataSourceBindings", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub data_source_bindings: Vec, @@ -277,7 +277,7 @@ pub struct ArtifactContributionDefinition { #[serde( rename = "inputDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_descriptors: Vec, @@ -329,7 +329,7 @@ pub struct ArtifactDownloadInputBase { #[serde( rename = "artifactItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub artifact_items: Vec, @@ -367,7 +367,7 @@ pub struct ArtifactFilter { #[doc = "Gets or sets the list of tags for the filter."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -458,7 +458,7 @@ pub struct ArtifactSourceId { #[serde( rename = "sourceIdInputs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub source_id_inputs: Vec, @@ -474,7 +474,7 @@ pub struct ArtifactSourceIdsQueryResult { #[serde( rename = "artifactSourceIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub artifact_source_ids: Vec, @@ -512,7 +512,7 @@ pub struct ArtifactSourceTrigger { #[serde( rename = "triggerConditions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub trigger_conditions: Vec, @@ -601,7 +601,7 @@ pub struct ArtifactTypeDefinition { #[serde( rename = "inputDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_descriptors: Vec, @@ -656,7 +656,7 @@ pub struct ArtifactVersion { #[doc = "Gets or sets the list of build versions of artifact."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub versions: Vec, @@ -672,7 +672,7 @@ pub struct ArtifactVersionQueryResult { #[serde( rename = "artifactVersions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub artifact_versions: Vec, @@ -687,7 +687,7 @@ pub struct ArtifactsDownloadInput { #[serde( rename = "downloadInputs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub download_inputs: Vec, @@ -1122,7 +1122,7 @@ pub struct ContainerImageTrigger { #[serde( rename = "tagFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tag_filters: Vec, @@ -1315,7 +1315,7 @@ pub struct DataSourceBindingBase { #[doc = "Gets or sets the authorization headers."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub headers: Vec, @@ -1434,7 +1434,7 @@ pub struct DeployPhase { #[serde( rename = "workflowTasks", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub workflow_tasks: Vec, @@ -1477,7 +1477,7 @@ pub struct Deployment { #[doc = "Gets the list of condition associated with deployment."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub conditions: Vec, @@ -1523,7 +1523,7 @@ pub struct Deployment { #[serde( rename = "postDeployApprovals", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub post_deploy_approvals: Vec, @@ -1531,7 +1531,7 @@ pub struct Deployment { #[serde( rename = "preDeployApprovals", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub pre_deploy_approvals: Vec, @@ -1690,7 +1690,7 @@ pub struct DeploymentApprovalPendingEvent { #[serde( rename = "completedApprovals", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub completed_approvals: Vec, @@ -1707,7 +1707,7 @@ pub struct DeploymentApprovalPendingEvent { #[serde( rename = "pendingApprovals", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub pending_approvals: Vec, @@ -1746,7 +1746,7 @@ pub struct DeploymentAttempt { #[doc = "All the issues related to the deployment."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub issues: Vec, @@ -1798,7 +1798,7 @@ pub struct DeploymentAttempt { #[serde( rename = "releaseDeployPhases", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub release_deploy_phases: Vec, @@ -1894,7 +1894,7 @@ pub struct DeploymentAuthorizationInfo { #[doc = "List of resources."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub resources: Vec, @@ -1972,7 +1972,7 @@ pub struct DeploymentInput { #[doc = "List demands that needs to meet to execute the job."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub demands: Vec, @@ -2006,7 +2006,7 @@ pub struct DeploymentJob { #[doc = "List of executed tasks with in job."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tasks: Vec, @@ -2022,7 +2022,7 @@ pub struct DeploymentList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2041,7 +2041,7 @@ pub struct DeploymentManualInterventionPendingEvent { #[serde( rename = "emailRecipients", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub email_recipients: Vec, @@ -2087,7 +2087,7 @@ pub struct DeploymentQueryParameters { #[serde( rename = "artifactVersions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub artifact_versions: Vec, @@ -2108,7 +2108,7 @@ pub struct DeploymentQueryParameters { #[doc = "Query deployments of specified environments."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub environments: Vec, @@ -2228,7 +2228,7 @@ pub struct EmailRecipients { #[serde( rename = "emailAddresses", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub email_addresses: Vec, @@ -2236,7 +2236,7 @@ pub struct EmailRecipients { #[serde( rename = "tfsIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tfs_ids: Vec, @@ -2392,7 +2392,7 @@ pub struct EnvironmentTriggerContent { #[serde( rename = "eventTypes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub event_types: Vec, @@ -2495,7 +2495,7 @@ pub struct FolderList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2514,7 +2514,7 @@ pub struct GateUpdateMetadata { #[serde( rename = "gatesToIgnore", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub gates_to_ignore: Vec, @@ -2700,7 +2700,7 @@ pub struct InputDescriptor { #[serde( rename = "dependencyInputIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dependency_input_ids: Vec, @@ -2905,7 +2905,7 @@ pub struct InputValues { #[serde( rename = "possibleValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub possible_values: Vec, @@ -2939,7 +2939,7 @@ pub struct InputValuesQuery { #[serde( rename = "inputValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_values: Vec, @@ -3016,7 +3016,7 @@ pub struct MachineGroupDeploymentInput { #[doc = "Deployment target tag filter."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -3052,7 +3052,7 @@ pub struct MailMessage { #[doc = "List of mail section types."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub sections: Vec, @@ -3173,7 +3173,7 @@ pub struct ManualInterventionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3362,20 +3362,20 @@ pub struct ProcessParameters { #[serde( rename = "dataSourceBindings", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub data_source_bindings: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub inputs: Vec, #[serde( rename = "sourceDefinitions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub source_definitions: Vec, @@ -3461,14 +3461,14 @@ pub struct PropertiesCollection { #[doc = "The set of keys in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub keys: Vec, #[doc = "The set of values in the collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -3483,7 +3483,7 @@ pub struct PropertySelector { #[doc = "List of properties."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub properties: Vec, @@ -3537,7 +3537,7 @@ pub struct PullRequestFilter { #[doc = "List of tags."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -3582,7 +3582,7 @@ pub struct PullRequestTrigger { #[serde( rename = "triggerConditions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub trigger_conditions: Vec, @@ -3667,7 +3667,7 @@ pub struct Release { #[doc = "Gets or sets the list of artifacts."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub artifacts: Vec, @@ -3703,7 +3703,7 @@ pub struct Release { #[doc = "Gets list of environments."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub environments: Vec, @@ -3782,7 +3782,7 @@ pub struct Release { #[doc = "Gets or sets list of tags."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -3796,7 +3796,7 @@ pub struct Release { #[serde( rename = "variableGroups", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub variable_groups: Vec, @@ -3886,7 +3886,7 @@ pub struct ReleaseApproval { #[doc = "Gets history which specifies all approvals associated with this approval."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub history: Vec, @@ -4013,7 +4013,7 @@ pub struct ReleaseApprovalList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4036,7 +4036,7 @@ pub struct ReleaseApprovalPendingEvent { #[serde( rename = "completedApprovals", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub completed_approvals: Vec, @@ -4062,7 +4062,7 @@ pub struct ReleaseApprovalPendingEvent { pub environment_name: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub environments: Vec, @@ -4075,7 +4075,7 @@ pub struct ReleaseApprovalPendingEvent { #[serde( rename = "pendingApprovals", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub pending_approvals: Vec, @@ -4186,7 +4186,7 @@ pub struct ReleaseDefinition { #[doc = "Gets or sets the list of artifacts."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub artifacts: Vec, @@ -4209,7 +4209,7 @@ pub struct ReleaseDefinition { #[doc = "Gets or sets the list of environments."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub environments: Vec, @@ -4255,14 +4255,14 @@ pub struct ReleaseDefinition { #[doc = "Gets or sets list of tags."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, #[doc = "Gets or sets the list of triggers."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub triggers: Vec, @@ -4270,7 +4270,7 @@ pub struct ReleaseDefinition { #[serde( rename = "variableGroups", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub variable_groups: Vec, @@ -4340,7 +4340,7 @@ pub struct ReleaseDefinitionApprovals { #[doc = "Gets or sets the approvals."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub approvals: Vec, @@ -4357,7 +4357,7 @@ pub struct ReleaseDefinitionDeployStep { #[doc = "The list of steps for this definition."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tasks: Vec, @@ -4375,7 +4375,7 @@ pub struct ReleaseDefinitionEnvironment { #[doc = "Gets or sets the environment conditions."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub conditions: Vec, @@ -4388,7 +4388,7 @@ pub struct ReleaseDefinitionEnvironment { #[doc = "Gets or sets the demands."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub demands: Vec, @@ -4396,7 +4396,7 @@ pub struct ReleaseDefinitionEnvironment { #[serde( rename = "deployPhases", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub deploy_phases: Vec, @@ -4416,7 +4416,7 @@ pub struct ReleaseDefinitionEnvironment { #[serde( rename = "environmentTriggers", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub environment_triggers: Vec, @@ -4483,7 +4483,7 @@ pub struct ReleaseDefinitionEnvironment { #[doc = "Gets or sets the schedules"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub schedules: Vec, @@ -4491,7 +4491,7 @@ pub struct ReleaseDefinitionEnvironment { #[serde( rename = "variableGroups", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub variable_groups: Vec, @@ -4524,7 +4524,7 @@ pub struct ReleaseDefinitionEnvironmentSummary { #[serde( rename = "lastReleases", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub last_releases: Vec, @@ -4580,7 +4580,7 @@ pub struct ReleaseDefinitionGate { #[doc = "Gets or sets the gates workflow."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tasks: Vec, @@ -4630,7 +4630,7 @@ pub struct ReleaseDefinitionGatesStep { #[doc = "Gets or sets the gates."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub gates: Vec, @@ -4655,7 +4655,7 @@ pub struct ReleaseDefinitionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4738,7 +4738,7 @@ pub struct ReleaseDefinitionRevisionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4782,7 +4782,7 @@ pub struct ReleaseDefinitionSummary { #[doc = "List of Release Definition environment summary."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub environments: Vec, @@ -4795,7 +4795,7 @@ pub struct ReleaseDefinitionSummary { #[doc = "List of releases deployed using this Release Definition."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub releases: Vec, @@ -4822,7 +4822,7 @@ pub struct ReleaseDeployPhase { #[serde( rename = "deploymentJobs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub deployment_jobs: Vec, @@ -4833,7 +4833,7 @@ pub struct ReleaseDeployPhase { #[serde( rename = "manualInterventions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub manual_interventions: Vec, @@ -4913,7 +4913,7 @@ pub struct ReleaseEnvironment { #[doc = "Gets list of conditions."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub conditions: Vec, @@ -4936,7 +4936,7 @@ pub struct ReleaseEnvironment { #[serde( rename = "deployPhasesSnapshot", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub deploy_phases_snapshot: Vec, @@ -4944,7 +4944,7 @@ pub struct ReleaseEnvironment { #[serde( rename = "deploySteps", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub deploy_steps: Vec, @@ -4988,7 +4988,7 @@ pub struct ReleaseEnvironment { #[serde( rename = "postDeployApprovals", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub post_deploy_approvals: Vec, @@ -5008,7 +5008,7 @@ pub struct ReleaseEnvironment { #[serde( rename = "preDeployApprovals", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub pre_deploy_approvals: Vec, @@ -5055,7 +5055,7 @@ pub struct ReleaseEnvironment { #[doc = "Gets list of schedules."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub schedules: Vec, @@ -5080,7 +5080,7 @@ pub struct ReleaseEnvironment { #[serde( rename = "variableGroups", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub variable_groups: Vec, @@ -5414,7 +5414,7 @@ pub struct ReleaseGates { #[serde( rename = "deploymentJobs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub deployment_jobs: Vec, @@ -5425,7 +5425,7 @@ pub struct ReleaseGates { #[serde( rename = "ignoredGates", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ignored_gates: Vec, @@ -5500,7 +5500,7 @@ pub struct ReleaseGatesPhase { #[serde( rename = "ignoredGates", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ignored_gates: Vec, @@ -5532,7 +5532,7 @@ pub struct ReleaseList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -5612,7 +5612,7 @@ pub struct ReleaseReference { #[doc = "Gets list of artifacts."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub artifacts: Vec, @@ -5852,7 +5852,7 @@ pub struct ReleaseStartMetadata { #[doc = "Sets list of artifact to create a release."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub artifacts: Vec, @@ -5870,7 +5870,7 @@ pub struct ReleaseStartMetadata { #[serde( rename = "environmentsMetadata", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub environments_metadata: Vec, @@ -5881,7 +5881,7 @@ pub struct ReleaseStartMetadata { #[serde( rename = "manualEnvironments", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub manual_environments: Vec, @@ -5936,7 +5936,7 @@ pub struct ReleaseTask { #[doc = "List of issues occurred while execution of task."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub issues: Vec, @@ -6074,7 +6074,7 @@ pub struct ReleaseTaskAttachmentList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -6090,7 +6090,7 @@ pub struct ReleaseTaskLogUpdatedEvent { pub realtime_release_event: RealtimeReleaseEvent, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub lines: Vec, @@ -6128,7 +6128,7 @@ pub struct ReleaseTasksUpdatedEvent { pub release_step_id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tasks: Vec, @@ -6190,7 +6190,7 @@ pub struct ReleaseUpdateMetadata { #[serde( rename = "manualEnvironments", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub manual_environments: Vec, @@ -6446,7 +6446,7 @@ pub struct SourceRepoTrigger { #[serde( rename = "branchFilters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub branch_filters: Vec, @@ -6518,7 +6518,7 @@ impl TagFilter { pub struct TaskInputDefinitionBase { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub aliases: Vec, @@ -6595,7 +6595,7 @@ pub struct TaskOrchestrationPlanGroupsStartedEvent { #[serde( rename = "planGroups", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub plan_groups: Vec, @@ -6667,7 +6667,7 @@ pub struct TimeZoneList { #[serde( rename = "validTimeZones", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub valid_time_zones: Vec, @@ -6728,7 +6728,7 @@ pub struct VariableGroup { #[serde( rename = "variableGroupProjectReferences", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub variable_group_project_references: Vec, @@ -6935,7 +6935,7 @@ pub struct YamlPipelineProcess { pub pipeline_process: PipelineProcess, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub errors: Vec, @@ -6959,13 +6959,13 @@ impl YamlPipelineProcess { pub struct YamlPipelineProcessResources { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub endpoints: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub queues: Vec, diff --git a/azure_devops_rust_api/src/search/mod.rs b/azure_devops_rust_api/src/search/mod.rs index 4c1bd076..61a5828b 100644 --- a/azure_devops_rust_api/src/search/mod.rs +++ b/azure_devops_rust_api/src/search/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://almsearch.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -180,50 +181,32 @@ pub mod package_search_results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PackageSearchResponseContent, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageSearchResponseContent = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn activity_id(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static("activityid")) + .get_str(&azure_core::http::headers::HeaderName::from_static( + "activityid", + )) } } #[derive(Clone)] @@ -257,34 +240,40 @@ pub mod package_search_results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/search/packagesearchresults", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -339,38 +328,15 @@ pub mod code_search_results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeSearchResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -405,24 +371,28 @@ pub mod code_search_results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/search/codesearchresults", self.client.endpoint(), &self.organization, @@ -430,10 +400,12 @@ pub mod code_search_results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -487,38 +459,18 @@ pub mod repositories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::RepositoryStatusResponse, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RepositoryStatusResponse = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -553,23 +505,27 @@ pub mod repositories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/search/status/repositories/{}", self.client.endpoint(), &self.organization, @@ -578,10 +534,12 @@ pub mod repositories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -633,40 +591,20 @@ pub mod tfvc { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TfvcRepositoryStatusResponse, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcRepositoryStatusResponse = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -700,23 +638,27 @@ pub mod tfvc { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/search/status/tfvc", self.client.endpoint(), &self.organization, @@ -724,10 +666,12 @@ pub mod tfvc { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -782,38 +726,15 @@ pub mod wiki_search_results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiSearchResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -848,24 +769,28 @@ pub mod wiki_search_results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/search/wikisearchresults", self.client.endpoint(), &self.organization, @@ -873,10 +798,12 @@ pub mod wiki_search_results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -930,38 +857,18 @@ pub mod work_item_search_results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemSearchResponse, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemSearchResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -996,24 +903,28 @@ pub mod work_item_search_results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/search/workitemsearchresults", self.client.endpoint(), &self.organization, @@ -1021,10 +932,12 @@ pub mod work_item_search_results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/search/models.rs b/azure_devops_rust_api/src/search/models.rs index 304100b2..e3e92e52 100644 --- a/azure_devops_rust_api/src/search/models.rs +++ b/azure_devops_rust_api/src/search/models.rs @@ -48,7 +48,7 @@ pub struct BoardSearchResponse { #[doc = "List of top matched Board documents."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -97,7 +97,7 @@ pub struct CodeResult { #[doc = "Versions of the result file."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub versions: Vec, @@ -136,7 +136,7 @@ pub struct CodeSearchResponse { #[doc = "List of matched files."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -202,7 +202,7 @@ pub struct CustomRepositoryStatusResponse { #[serde( rename = "indexedTopLevelFolders", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub indexed_top_level_folders: Vec, @@ -236,7 +236,7 @@ pub struct EntitySearchRequest { #[serde( rename = "$orderBy", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub order_by: Vec, @@ -340,7 +340,7 @@ pub struct FeedInfo { #[doc = "List of views which contain the matched package."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub views: Vec, @@ -420,7 +420,7 @@ pub struct PackageHit { #[doc = "Matched/highlighted snippets of the field."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub highlights: Vec, @@ -439,14 +439,14 @@ pub struct PackageResult { #[doc = "List of feeds which contain the matching package."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub feeds: Vec, #[doc = "List of highlighted fields for the match."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub hits: Vec, @@ -485,7 +485,7 @@ pub struct PackageSearchResponse { #[serde( rename = "activityId", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub activity_id: Vec, @@ -509,7 +509,7 @@ pub struct PackageSearchResponseContent { #[doc = "List of matched packages."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -593,7 +593,7 @@ pub struct RepositoryStatusResponse { #[serde( rename = "indexedBranches", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub indexed_branches: Vec, @@ -695,7 +695,7 @@ pub struct SettingSearchResponse { #[doc = "List of top matched setting documents."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -745,7 +745,7 @@ pub struct TfvcRepositoryStatusResponse { #[serde( rename = "indexingInformation", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub indexing_information: Vec, @@ -815,7 +815,7 @@ pub struct WikiHit { #[doc = "Matched/highlighted snippets of the field."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub highlights: Vec, @@ -840,7 +840,7 @@ pub struct WikiResult { #[doc = "Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub hits: Vec, @@ -881,7 +881,7 @@ pub struct WikiSearchResponse { #[doc = "List of top matched wiki documents."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -904,7 +904,7 @@ pub struct WorkItemHit { #[doc = "Matched/highlighted snippets of the field."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub highlights: Vec, @@ -923,7 +923,7 @@ pub struct WorkItemResult { #[doc = "Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub hits: Vec, @@ -961,7 +961,7 @@ pub struct WorkItemSearchResponse { #[doc = "List of top matched work items."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, diff --git a/azure_devops_rust_api/src/security/mod.rs b/azure_devops_rust_api/src/security/mod.rs index ceb7991b..af0f96c4 100644 --- a/azure_devops_rust_api/src/security/mod.rs +++ b/azure_devops_rust_api/src/security/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -194,38 +195,18 @@ pub mod access_control_entries { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::AccessControlEntryList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AccessControlEntryList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -260,24 +241,28 @@ pub mod access_control_entries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/accesscontrolentries/{}", self.client.endpoint(), &self.organization, @@ -285,10 +270,12 @@ pub mod access_control_entries { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -314,37 +301,13 @@ pub mod access_control_entries { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: bool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -390,14 +353,18 @@ pub mod access_control_entries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(token) = &this.token { req.url_mut().query_pairs_mut().append_pair("token", token); @@ -407,14 +374,14 @@ pub mod access_control_entries { .query_pairs_mut() .append_pair("descriptors", descriptors); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/accesscontrolentries/{}", self.client.endpoint(), &self.organization, @@ -422,10 +389,12 @@ pub mod access_control_entries { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -517,38 +486,15 @@ pub mod access_control_lists { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AccessControlListList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -606,14 +552,18 @@ pub mod access_control_lists { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(token) = &this.token { req.url_mut().query_pairs_mut().append_pair("token", token); @@ -634,14 +584,14 @@ pub mod access_control_lists { .query_pairs_mut() .append_pair("recurse", &recurse.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/accesscontrollists/{}", self.client.endpoint(), &self.organization, @@ -649,10 +599,12 @@ pub mod access_control_lists { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -677,23 +629,10 @@ pub mod access_control_lists { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -728,24 +667,28 @@ pub mod access_control_lists { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/accesscontrollists/{}", self.client.endpoint(), &self.organization, @@ -753,10 +696,12 @@ pub mod access_control_lists { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -784,37 +729,13 @@ pub mod access_control_lists { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: bool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -860,14 +781,18 @@ pub mod access_control_lists { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(tokens) = &this.tokens { req.url_mut() @@ -879,14 +804,14 @@ pub mod access_control_lists { .query_pairs_mut() .append_pair("recurse", &recurse.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/accesscontrollists/{}", self.client.endpoint(), &self.organization, @@ -894,10 +819,12 @@ pub mod access_control_lists { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -993,37 +920,13 @@ pub mod permissions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1079,14 +982,18 @@ pub mod permissions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(tokens) = &this.tokens { req.url_mut() @@ -1105,14 +1012,14 @@ pub mod permissions { .query_pairs_mut() .append_pair("delimiter", delimiter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/permissions/{}/{}", self.client.endpoint(), &self.organization, @@ -1121,10 +1028,12 @@ pub mod permissions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1149,38 +1058,15 @@ pub mod permissions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AccessControlEntry = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1222,14 +1108,18 @@ pub mod permissions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let descriptor = &this.descriptor; req.url_mut() @@ -1238,14 +1128,14 @@ pub mod permissions { if let Some(token) = &this.token { req.url_mut().query_pairs_mut().append_pair("token", token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/permissions/{}/{}", self.client.endpoint(), &self.organization, @@ -1254,10 +1144,12 @@ pub mod permissions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1282,38 +1174,18 @@ pub mod permissions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::PermissionEvaluationBatch, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PermissionEvaluationBatch = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1347,34 +1219,40 @@ pub mod permissions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/security/permissionevaluationbatch", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1427,40 +1305,20 @@ pub mod security_namespaces { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::SecurityNamespaceDescriptionList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SecurityNamespaceDescriptionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1500,28 +1358,32 @@ pub mod security_namespaces { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(local_only) = &this.local_only { req.url_mut() .query_pairs_mut() .append_pair("localOnly", &local_only.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/securitynamespaces/{}", self.client.endpoint(), &self.organization, @@ -1529,10 +1391,12 @@ pub mod security_namespaces { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/security/models.rs b/azure_devops_rust_api/src/security/models.rs index fca3d593..869b5618 100644 --- a/azure_devops_rust_api/src/security/models.rs +++ b/azure_devops_rust_api/src/security/models.rs @@ -36,7 +36,7 @@ pub struct AccessControlEntryList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -94,7 +94,7 @@ pub struct AccessControlListList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -248,7 +248,7 @@ pub struct PermissionEvaluationBatch { #[doc = "Array of permission evaluations to evaluate."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub evaluations: Vec, @@ -264,7 +264,7 @@ pub struct SecurityNamespaceDescription { #[doc = "The list of actions that this Security Namespace is responsible for securing."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub actions: Vec, @@ -367,7 +367,7 @@ pub struct SecurityNamespaceDescriptionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/security_roles/mod.rs b/azure_devops_rust_api/src/security_roles/mod.rs index 0fcdbb97..e735a8cb 100644 --- a/azure_devops_rust_api/src/security_roles/mod.rs +++ b/azure_devops_rust_api/src/security_roles/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -274,23 +275,10 @@ pub mod roleassignments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -326,33 +314,39 @@ pub mod roleassignments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let inherit_permissions = &this.inherit_permissions; req.url_mut() .query_pairs_mut() .append_pair("inheritPermissions", &inherit_permissions.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}?inheritPermissions={}" , self . client . endpoint () , & self . organization , & self . scope_id , & self . resource_id , & self . inherit_permissions)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}?inheritPermissions={}" , self . client . endpoint () , & self . organization , & self . scope_id , & self . resource_id , & self . inherit_permissions)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -380,38 +374,15 @@ pub mod roleassignments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RoleAssignmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -446,23 +417,27 @@ pub mod roleassignments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", self.client.endpoint(), &self.organization, @@ -471,10 +446,12 @@ pub mod roleassignments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -499,38 +476,15 @@ pub mod roleassignments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RoleAssignmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -574,17 +528,21 @@ pub mod roleassignments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(limit_to_caller_identity_domain) = &this.limit_to_caller_identity_domain { @@ -594,12 +552,12 @@ pub mod roleassignments { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", self.client.endpoint(), &self.organization, @@ -608,10 +566,12 @@ pub mod roleassignments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -636,23 +596,10 @@ pub mod roleassignments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -688,24 +635,28 @@ pub mod roleassignments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", self.client.endpoint(), &self.organization, @@ -714,10 +665,12 @@ pub mod roleassignments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -745,37 +698,15 @@ pub mod roleassignments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RoleAssignment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -812,24 +743,28 @@ pub mod roleassignments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}/{}", self.client.endpoint(), &self.organization, @@ -839,10 +774,12 @@ pub mod roleassignments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -867,23 +804,10 @@ pub mod roleassignments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -919,23 +843,27 @@ pub mod roleassignments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}/{}", self.client.endpoint(), &self.organization, @@ -945,10 +873,12 @@ pub mod roleassignments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -999,38 +929,15 @@ pub mod roledefinitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SecurityRoleList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1064,23 +971,27 @@ pub mod roledefinitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/securityroles/scopes/{}/roledefinitions", self.client.endpoint(), &self.organization, @@ -1088,10 +999,12 @@ pub mod roledefinitions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/security_roles/models.rs b/azure_devops_rust_api/src/security_roles/models.rs index 8bd20deb..4ee44f33 100644 --- a/azure_devops_rust_api/src/security_roles/models.rs +++ b/azure_devops_rust_api/src/security_roles/models.rs @@ -139,7 +139,7 @@ pub struct RoleAssignmentList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -196,7 +196,7 @@ pub struct SecurityRoleList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/serde.rs b/azure_devops_rust_api/src/serde.rs index beecc678..2cf898c9 100644 --- a/azure_devops_rust_api/src/serde.rs +++ b/azure_devops_rust_api/src/serde.rs @@ -10,3 +10,14 @@ where let opt = Option::deserialize(deserializer)?; Ok(opt.unwrap_or_default()) } + +/// Deserialize JSON null as default +/// +pub fn deserialize_null_as_default<'de, D, T>(deserializer: D) -> Result +where + T: Default + Deserialize<'de>, + D: Deserializer<'de>, +{ + let opt = Option::deserialize(deserializer)?; + Ok(opt.unwrap_or_default()) +} diff --git a/azure_devops_rust_api/src/service_endpoint/mod.rs b/azure_devops_rust_api/src/service_endpoint/mod.rs index f831f6f4..2dba4ab0 100644 --- a/azure_devops_rust_api/src/service_endpoint/mod.rs +++ b/azure_devops_rust_api/src/service_endpoint/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -199,40 +200,20 @@ pub mod endpointproxy { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ServiceEndpointRequestResult, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointRequestResult = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -268,28 +249,32 @@ pub mod endpointproxy { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let endpoint_id = &this.endpoint_id; req.url_mut() .query_pairs_mut() .append_pair("endpointId", endpoint_id); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/serviceendpoint/endpointproxy?endpointId={}", self.client.endpoint(), &self.organization, @@ -298,10 +283,12 @@ pub mod endpointproxy { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -327,37 +314,13 @@ pub mod endpointproxy { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -392,24 +355,28 @@ pub mod endpointproxy { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/serviceendpoint/endpointproxy", self.client.endpoint(), &self.organization, @@ -417,10 +384,12 @@ pub mod endpointproxy { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -635,38 +604,15 @@ pub mod endpoints { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -742,14 +688,18 @@ pub mod endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(type_) = &this.type_ { req.url_mut().query_pairs_mut().append_pair("type", type_); @@ -782,14 +732,14 @@ pub mod endpoints { .query_pairs_mut() .append_pair("actionFilter", action_filter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/serviceendpoint/endpoints?", self.client.endpoint(), &self.organization, @@ -797,10 +747,12 @@ pub mod endpoints { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -825,38 +777,15 @@ pub mod endpoints { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpoint = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -890,34 +819,40 @@ pub mod endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/serviceendpoint/endpoints", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -942,38 +877,15 @@ pub mod endpoints { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1007,34 +919,40 @@ pub mod endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/serviceendpoint/endpoints", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1059,38 +977,15 @@ pub mod endpoints { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpoint = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1131,29 +1026,33 @@ pub mod endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(operation) = &this.operation { req.url_mut() .query_pairs_mut() .append_pair("operation", operation); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/serviceendpoint/endpoints/{}", self.client.endpoint(), &self.organization, @@ -1161,10 +1060,12 @@ pub mod endpoints { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1189,23 +1090,10 @@ pub mod endpoints { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1240,24 +1128,28 @@ pub mod endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/serviceendpoint/endpoints/{}", self.client.endpoint(), &self.organization, @@ -1265,10 +1157,12 @@ pub mod endpoints { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1296,23 +1190,10 @@ pub mod endpoints { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1353,14 +1234,18 @@ pub mod endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let project_ids = &this.project_ids; req.url_mut() @@ -1371,14 +1256,14 @@ pub mod endpoints { .query_pairs_mut() .append_pair("deep", &deep.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/serviceendpoint/endpoints/{}", self.client.endpoint(), &self.organization, @@ -1386,10 +1271,12 @@ pub mod endpoints { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1417,38 +1304,15 @@ pub mod endpoints { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1513,14 +1377,18 @@ pub mod endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let endpoint_names = &this.endpoint_names; req.url_mut() @@ -1547,14 +1415,14 @@ pub mod endpoints { .query_pairs_mut() .append_pair("includeDetails", &include_details.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/serviceendpoint/endpoints", self.client.endpoint(), &self.organization, @@ -1562,10 +1430,12 @@ pub mod endpoints { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1590,38 +1460,15 @@ pub mod endpoints { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1657,28 +1504,32 @@ pub mod endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let endpoint_ids = &this.endpoint_ids; req.url_mut() .query_pairs_mut() .append_pair("endpointIds", endpoint_ids); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/serviceendpoint/endpoints", self.client.endpoint(), &self.organization, @@ -1686,10 +1537,12 @@ pub mod endpoints { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1714,38 +1567,15 @@ pub mod endpoints { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpoint = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1786,28 +1616,32 @@ pub mod endpoints { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(action_filter) = &this.action_filter { req.url_mut() .query_pairs_mut() .append_pair("actionFilter", action_filter); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/serviceendpoint/endpoints/{}", self.client.endpoint(), &self.organization, @@ -1816,10 +1650,12 @@ pub mod endpoints { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1866,38 +1702,18 @@ pub mod types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ServiceEndpointTypeList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointTypeList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1942,14 +1758,18 @@ pub mod types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(type_) = &this.type_ { req.url_mut().query_pairs_mut().append_pair("type", type_); @@ -1959,24 +1779,26 @@ pub mod types { .query_pairs_mut() .append_pair("scheme", scheme); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/serviceendpoint/types", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2033,40 +1855,20 @@ pub mod executionhistory { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ServiceEndpointExecutionRecordList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointExecutionRecordList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2113,14 +1915,18 @@ pub mod executionhistory { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -2132,14 +1938,14 @@ pub mod executionhistory { .query_pairs_mut() .append_pair("continuationToken", &continuation_token.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/serviceendpoint/{}/executionhistory", self.client.endpoint(), &self.organization, @@ -2148,10 +1954,12 @@ pub mod executionhistory { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/service_endpoint/models.rs b/azure_devops_rust_api/src/service_endpoint/models.rs index ea112b7a..38751afc 100644 --- a/azure_devops_rust_api/src/service_endpoint/models.rs +++ b/azure_devops_rust_api/src/service_endpoint/models.rs @@ -160,7 +160,7 @@ pub struct AzureManagementGroupQueryResult { #[doc = "List of azure management groups"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -278,7 +278,7 @@ pub struct AzureSubscriptionQueryResult { pub error_message: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -334,7 +334,7 @@ pub struct DataSource { #[doc = "Gets or sets the authorization headers of the request."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub headers: Vec, @@ -434,7 +434,7 @@ pub struct DataSourceBindingBase { #[doc = "Gets or sets the authorization headers."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub headers: Vec, @@ -505,7 +505,7 @@ pub struct DataSourceDetails { #[doc = "Gets or sets the request headers."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub headers: Vec, @@ -577,7 +577,7 @@ pub struct DependencyData { #[doc = "Gets or sets the key-value pair to specify properties and their values."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub map: Vec, @@ -596,7 +596,7 @@ pub struct DependsOn { #[doc = "Gets or sets key-value pair containing other's field value and corresponding url value."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub map: Vec, @@ -783,7 +783,7 @@ pub struct InputDescriptor { #[serde( rename = "dependencyInputIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dependency_input_ids: Vec, @@ -988,7 +988,7 @@ pub struct InputValues { #[serde( rename = "possibleValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub possible_values: Vec, @@ -1218,11 +1218,12 @@ impl Parameter { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProjectReference { pub id: String, - pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, } impl ProjectReference { - pub fn new(id: String, name: String) -> Self { - Self { id, name } + pub fn new(id: String) -> Self { + Self { id, name: None } } } #[doc = "The class to represent a collection of REST reference links."] @@ -1250,7 +1251,7 @@ pub struct RefreshAuthenticationParameters { #[doc = "Scope of the token requested. For GitHub marketplace apps, scope contains repository Ids"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub scope: Vec, @@ -1312,7 +1313,8 @@ pub struct ServiceEndpoint { pub created_by: IdentityRef, pub data: serde_json::Value, #[doc = "Gets or sets the description of endpoint."] - pub description: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, #[doc = "This is a deprecated field."] #[serde( rename = "groupScopeId", @@ -1349,7 +1351,7 @@ pub struct ServiceEndpoint { #[serde( rename = "serviceEndpointProjectReferences", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub service_endpoint_project_references: Vec, @@ -1364,7 +1366,6 @@ impl ServiceEndpoint { authorization: EndpointAuthorization, created_by: IdentityRef, data: serde_json::Value, - description: String, id: String, is_ready: bool, is_shared: bool, @@ -1378,7 +1379,7 @@ impl ServiceEndpoint { authorization, created_by, data, - description, + description: None, group_scope_id: None, id, is_ready, @@ -1400,7 +1401,7 @@ pub struct ServiceEndpointAuthenticationScheme { #[serde( rename = "authorizationHeaders", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub authorization_headers: Vec, @@ -1415,7 +1416,7 @@ pub struct ServiceEndpointAuthenticationScheme { #[serde( rename = "clientCertificates", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub client_certificates: Vec, @@ -1423,7 +1424,7 @@ pub struct ServiceEndpointAuthenticationScheme { #[serde( rename = "dataSourceBindings", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub data_source_bindings: Vec, @@ -1438,7 +1439,7 @@ pub struct ServiceEndpointAuthenticationScheme { #[serde( rename = "inputDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_descriptors: Vec, @@ -1591,7 +1592,7 @@ pub struct ServiceEndpointExecutionRecordList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1609,7 +1610,7 @@ pub struct ServiceEndpointExecutionRecordsInput { #[serde( rename = "endpointIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub endpoint_ids: Vec, @@ -1625,7 +1626,7 @@ pub struct ServiceEndpointList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1664,17 +1665,19 @@ impl ServiceEndpointOAuthConfigurationReference { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceEndpointProjectReference { #[doc = "Gets or sets description of the service endpoint."] - pub description: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, #[doc = "Gets or sets name of the service endpoint."] - pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, #[serde(rename = "projectReference")] pub project_reference: ProjectReference, } impl ServiceEndpointProjectReference { - pub fn new(description: String, name: String, project_reference: ProjectReference) -> Self { + pub fn new(project_reference: ProjectReference) -> Self { Self { - description, - name, + description: None, + name: None, project_reference, } } @@ -1856,7 +1859,7 @@ pub struct ServiceEndpointType { #[serde( rename = "authenticationSchemes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub authentication_schemes: Vec, @@ -1864,7 +1867,7 @@ pub struct ServiceEndpointType { #[serde( rename = "dataSources", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub data_sources: Vec, @@ -1872,7 +1875,7 @@ pub struct ServiceEndpointType { #[serde( rename = "dependencyData", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dependency_data: Vec, @@ -1910,7 +1913,7 @@ pub struct ServiceEndpointType { #[serde( rename = "inputDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub input_descriptors: Vec, @@ -1921,7 +1924,7 @@ pub struct ServiceEndpointType { #[serde( rename = "trustedHosts", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub trusted_hosts: Vec, @@ -1944,7 +1947,7 @@ pub struct ServiceEndpointTypeList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/status/mod.rs b/azure_devops_rust_api/src/status/mod.rs index 8c69c579..0b694be9 100644 --- a/azure_devops_rust_api/src/status/mod.rs +++ b/azure_devops_rust_api/src/status/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://status.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -157,37 +158,15 @@ pub mod health { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceStatus = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -231,14 +210,18 @@ pub mod health { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(services) = &this.services { req.url_mut() @@ -250,23 +233,25 @@ pub mod health { .query_pairs_mut() .append_pair("geographies", geographies); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/_apis/status/health", self.client.endpoint(), ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/status/models.rs b/azure_devops_rust_api/src/status/models.rs index 5d093e6c..8412cbfd 100644 --- a/azure_devops_rust_api/src/status/models.rs +++ b/azure_devops_rust_api/src/status/models.rs @@ -11,7 +11,7 @@ pub struct EnterpriseStatus { pub status: Status, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub organizations: Vec, @@ -74,7 +74,7 @@ pub struct LiveSiteEvent { pub id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub impact: Vec, @@ -88,7 +88,7 @@ pub struct LiveSiteEvent { pub is_deleted: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub logs: Vec, @@ -313,7 +313,7 @@ pub struct LiveSiteEventTemplateData { pub intermediate_description: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub templates: Vec, @@ -332,13 +332,13 @@ pub struct MicroService { #[serde( rename = "scaleUnits", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub scale_units: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub services: Vec, @@ -374,7 +374,7 @@ pub struct OrganizationHealth { pub name: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub services: Vec, @@ -418,7 +418,7 @@ pub mod service { pub struct ServiceHealth { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub geographies: Vec, @@ -438,7 +438,7 @@ pub struct ServiceStatus { pub status: Status, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub services: Vec, @@ -504,7 +504,7 @@ pub struct StatusImpact { #[serde( rename = "liveSiteEvents", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub live_site_events: Vec, diff --git a/azure_devops_rust_api/src/symbol/mod.rs b/azure_devops_rust_api/src/symbol/mod.rs index fb869aab..8ee57d38 100644 --- a/azure_devops_rust_api/src/symbol/mod.rs +++ b/azure_devops_rust_api/src/symbol/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://artifacts.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -325,37 +326,15 @@ pub mod requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DebugEntryList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -391,17 +370,21 @@ pub mod requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let request_name = &this.request_name; req.url_mut() .query_pairs_mut() @@ -411,12 +394,12 @@ pub mod requests { .query_pairs_mut() .append_pair("collection", collection); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/requests?requestName={}&collection={}", self.client.endpoint(), &self.organization, @@ -425,10 +408,12 @@ pub mod requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -453,37 +438,15 @@ pub mod requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -517,37 +480,43 @@ pub mod requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let request_name = &this.request_name; req.url_mut() .query_pairs_mut() .append_pair("requestName", request_name); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/requests", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -572,37 +541,15 @@ pub mod requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -636,34 +583,40 @@ pub mod requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/requests", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -688,37 +641,15 @@ pub mod requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -753,38 +684,44 @@ pub mod requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let request_name = &this.request_name; req.url_mut() .query_pairs_mut() .append_pair("requestName", request_name); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/requests", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -809,23 +746,10 @@ pub mod requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -865,14 +789,18 @@ pub mod requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let request_name = &this.request_name; req.url_mut() @@ -883,24 +811,26 @@ pub mod requests { .query_pairs_mut() .append_pair("synchronous", &synchronous.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/requests", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -928,37 +858,15 @@ pub mod requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -992,23 +900,27 @@ pub mod requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/requests/{}", self.client.endpoint(), &self.organization, @@ -1016,10 +928,12 @@ pub mod requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1044,37 +958,15 @@ pub mod requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DebugEntryList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1110,28 +1002,32 @@ pub mod requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let collection = &this.collection; req.url_mut() .query_pairs_mut() .append_pair("collection", collection); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/requests/{}", self.client.endpoint(), &self.organization, @@ -1139,10 +1035,12 @@ pub mod requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1167,37 +1065,15 @@ pub mod requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1232,24 +1108,28 @@ pub mod requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/requests/{}", self.client.endpoint(), &self.organization, @@ -1257,10 +1137,12 @@ pub mod requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1285,23 +1167,10 @@ pub mod requests { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1341,28 +1210,32 @@ pub mod requests { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(synchronous) = &this.synchronous { req.url_mut() .query_pairs_mut() .append_pair("synchronous", &synchronous.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/requests/{}", self.client.endpoint(), &self.organization, @@ -1370,10 +1243,12 @@ pub mod requests { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1424,23 +1299,10 @@ pub mod availability { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1473,33 +1335,39 @@ pub mod availability { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/availability", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1563,23 +1431,10 @@ pub mod client { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1612,33 +1467,39 @@ pub mod client { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Head); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/client", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1666,37 +1527,13 @@ pub mod client { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1730,23 +1567,27 @@ pub mod client { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/client/{}", self.client.endpoint(), &self.organization, @@ -1754,10 +1595,12 @@ pub mod client { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1811,23 +1654,10 @@ pub mod contents { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1862,23 +1692,27 @@ pub mod contents { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/requests/{}/contents/{}", self.client.endpoint(), &self.organization, @@ -1887,10 +1721,12 @@ pub mod contents { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1944,23 +1780,10 @@ pub mod symsrv { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1994,23 +1817,27 @@ pub mod symsrv { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/symbol/symsrv/{}", self.client.endpoint(), &self.organization, @@ -2018,10 +1845,12 @@ pub mod symsrv { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/symbol/models.rs b/azure_devops_rust_api/src/symbol/models.rs index 367129cd..7f5c6205 100644 --- a/azure_devops_rust_api/src/symbol/models.rs +++ b/azure_devops_rust_api/src/symbol/models.rs @@ -102,7 +102,7 @@ pub struct DebugEntryCreateBatch { #[serde( rename = "debugEntries", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub debug_entries: Vec, @@ -110,7 +110,7 @@ pub struct DebugEntryCreateBatch { #[serde( rename = "proofNodes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub proof_nodes: Vec, @@ -139,7 +139,7 @@ pub struct DebugEntryList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -163,7 +163,7 @@ pub struct JsonBlobBlockHash { #[serde( rename = "hashBytes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub hash_bytes: Vec, @@ -178,7 +178,7 @@ pub struct JsonBlobIdentifier { #[serde( rename = "identifierValue", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub identifier_value: Vec, @@ -195,7 +195,7 @@ pub struct JsonBlobIdentifierWithBlocks { #[serde( rename = "blockHashes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub block_hashes: Vec, @@ -203,7 +203,7 @@ pub struct JsonBlobIdentifierWithBlocks { #[serde( rename = "identifierValue", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub identifier_value: Vec, diff --git a/azure_devops_rust_api/src/telemetry.rs b/azure_devops_rust_api/src/telemetry.rs index 89fe8914..ed782d15 100644 --- a/azure_devops_rust_api/src/telemetry.rs +++ b/azure_devops_rust_api/src/telemetry.rs @@ -3,7 +3,11 @@ //! Azure DevOps telemetry support. use async_trait::async_trait; -use azure_core::{headers::Headers, Context, Policy, PolicyResult, Request, Response}; +use azure_core::http::{ + headers::Headers, + policies::{Policy, PolicyResult}, + BufResponse, Context, Request, +}; use std::sync::Arc; use tracing::{error, info}; @@ -29,7 +33,7 @@ impl RequestLogger { #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] #[cfg_attr(not(target_arch = "wasm32"), async_trait)] -impl azure_core::Policy for RequestLogger { +impl Policy for RequestLogger { async fn send( &self, ctx: &Context, @@ -75,7 +79,7 @@ impl azure_core::Policy for RequestLogger { ); let response_stream = Box::pin(futures::stream::once(futures::future::ready(response_body))); - Ok(Response::new(status_code, headers, response_stream)) + Ok(BufResponse::new(status_code, headers, response_stream)) } Err(err) => { error!( diff --git a/azure_devops_rust_api/src/test/mod.rs b/azure_devops_rust_api/src/test/mod.rs index d5390891..302bc64f 100644 --- a/azure_devops_rust_api/src/test/mod.rs +++ b/azure_devops_rust_api/src/test/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -338,37 +339,15 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -488,23 +467,31 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let min_last_updated_date = &this.min_last_updated_date; + let formatted_date_time = + crate::date_time::format_date_time(min_last_updated_date)?; req.url_mut() .query_pairs_mut() - .append_pair("minLastUpdatedDate", &min_last_updated_date.to_string()); + .append_pair("minLastUpdatedDate", &formatted_date_time); let max_last_updated_date = &this.max_last_updated_date; + let formatted_date_time = + crate::date_time::format_date_time(max_last_updated_date)?; req.url_mut() .query_pairs_mut() - .append_pair("maxLastUpdatedDate", &max_last_updated_date.to_string()); + .append_pair("maxLastUpdatedDate", &formatted_date_time); if let Some(state) = &this.state { req.url_mut().query_pairs_mut().append_pair("state", state); } @@ -573,14 +560,14 @@ pub mod runs { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/runs?minLastUpdatedDate={}&maxLastUpdatedDate={}", self.client.endpoint(), &self.organization, @@ -590,10 +577,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -618,37 +607,15 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -729,14 +696,18 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(build_uri) = &this.build_uri { req.url_mut() @@ -776,14 +747,14 @@ pub mod runs { .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/runs", self.client.endpoint(), &self.organization, @@ -791,10 +762,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -819,37 +792,15 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRun = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -884,24 +835,28 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/runs", self.client.endpoint(), &self.organization, @@ -909,10 +864,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -937,37 +894,15 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRun = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1008,28 +943,32 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_details) = &this.include_details { req.url_mut() .query_pairs_mut() .append_pair("includeDetails", &include_details.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/runs/{}", self.client.endpoint(), &self.organization, @@ -1038,10 +977,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1066,37 +1007,15 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRun = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1132,24 +1051,28 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/runs/{}", self.client.endpoint(), &self.organization, @@ -1158,10 +1081,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1186,23 +1111,10 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1237,23 +1149,27 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/runs/{}", self.client.endpoint(), &self.organization, @@ -1262,10 +1178,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1293,38 +1211,15 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunStatistic = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1359,23 +1254,27 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/runs/{}/Statistics", self.client.endpoint(), &self.organization, @@ -1384,10 +1283,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1638,38 +1539,15 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1706,27 +1584,31 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_sub_result_id = &this.test_sub_result_id; req.url_mut() .query_pairs_mut() .append_pair("testSubResultId", &test_sub_result_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments?testSubResultId={}", self.client.endpoint(), &self.organization, @@ -1737,10 +1619,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1765,38 +1649,18 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestAttachmentReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentReference = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1834,28 +1698,32 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let test_sub_result_id = &this.test_sub_result_id; req.url_mut() .query_pairs_mut() .append_pair("testSubResultId", &test_sub_result_id.to_string()); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments?testSubResultId={}", self.client.endpoint(), &self.organization, @@ -1866,10 +1734,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1895,37 +1765,13 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1963,27 +1809,31 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_sub_result_id = &this.test_sub_result_id; req.url_mut() .query_pairs_mut() .append_pair("testSubResultId", &test_sub_result_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments/{}?testSubResultId={}", self.client.endpoint(), &self.organization, @@ -1995,10 +1845,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2023,38 +1875,15 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2089,23 +1918,27 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/attachments", self.client.endpoint(), &self.organization, @@ -2114,10 +1947,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2142,38 +1977,18 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestAttachmentReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentReference = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2209,24 +2024,28 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/attachments", self.client.endpoint(), &self.organization, @@ -2235,10 +2054,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2264,37 +2085,13 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2330,23 +2127,27 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/attachments/{}", self.client.endpoint(), &self.organization, @@ -2356,10 +2157,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2384,38 +2187,15 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2451,23 +2231,27 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments", self.client.endpoint(), &self.organization, @@ -2477,10 +2261,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2505,38 +2291,18 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestAttachmentReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentReference = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2573,24 +2339,28 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments", self.client.endpoint(), &self.organization, @@ -2600,10 +2370,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2629,37 +2401,13 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2696,23 +2444,27 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments/{}", self.client.endpoint(), &self.organization, @@ -2723,10 +2475,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2805,38 +2559,15 @@ pub mod code_coverage { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildCoverageList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2872,14 +2603,18 @@ pub mod code_coverage { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build_id = &this.build_id; req.url_mut() @@ -2889,14 +2624,14 @@ pub mod code_coverage { req.url_mut() .query_pairs_mut() .append_pair("flags", &flags.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/codecoverage", self.client.endpoint(), &self.organization, @@ -2904,10 +2639,12 @@ pub mod code_coverage { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2932,38 +2669,15 @@ pub mod code_coverage { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunCoverageList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2999,27 +2713,31 @@ pub mod code_coverage { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let flags = &this.flags; req.url_mut() .query_pairs_mut() .append_pair("flags", &flags.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/codecoverage", self.client.endpoint(), &self.organization, @@ -3028,10 +2746,12 @@ pub mod code_coverage { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3170,37 +2890,15 @@ pub mod points { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3278,14 +2976,18 @@ pub mod points { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(wit_fields) = &this.wit_fields { req.url_mut() @@ -3323,14 +3025,14 @@ pub mod points { .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points", self.client.endpoint(), &self.organization, @@ -3340,10 +3042,12 @@ pub mod points { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3368,37 +3072,15 @@ pub mod points { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPoint = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3441,28 +3123,32 @@ pub mod points { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(wit_fields) = &this.wit_fields { req.url_mut() .query_pairs_mut() .append_pair("witFields", wit_fields); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points/{}", self.client.endpoint(), &self.organization, @@ -3473,10 +3159,12 @@ pub mod points { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3501,37 +3189,15 @@ pub mod points { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3569,24 +3235,28 @@ pub mod points { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points/{}", self.client.endpoint(), &self.organization, @@ -3597,10 +3267,12 @@ pub mod points { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3625,38 +3297,15 @@ pub mod points { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPointsQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3703,17 +3352,21 @@ pub mod points { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(skip) = &this.skip { req.url_mut() .query_pairs_mut() @@ -3725,12 +3378,12 @@ pub mod points { .append_pair("$top", &top.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/points", self.client.endpoint(), &self.organization, @@ -3738,10 +3391,12 @@ pub mod points { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3901,38 +3556,15 @@ pub mod test_suites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SuiteTestCaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3968,23 +3600,27 @@ pub mod test_suites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases", self.client.endpoint(), &self.organization, @@ -3994,10 +3630,12 @@ pub mod test_suites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4022,37 +3660,15 @@ pub mod test_suites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SuiteTestCase = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4089,23 +3705,27 @@ pub mod test_suites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", self.client.endpoint(), &self.organization, @@ -4116,10 +3736,12 @@ pub mod test_suites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4144,38 +3766,15 @@ pub mod test_suites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SuiteTestCaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4212,24 +3811,28 @@ pub mod test_suites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", self.client.endpoint(), &self.organization, @@ -4240,10 +3843,12 @@ pub mod test_suites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4268,38 +3873,15 @@ pub mod test_suites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SuiteTestCaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4337,24 +3919,28 @@ pub mod test_suites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", self.client.endpoint(), &self.organization, @@ -4365,10 +3951,12 @@ pub mod test_suites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4393,23 +3981,10 @@ pub mod test_suites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4446,23 +4021,27 @@ pub mod test_suites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", self.client.endpoint(), &self.organization, @@ -4473,10 +4052,12 @@ pub mod test_suites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4549,38 +4130,18 @@ pub mod result_retention_settings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ResultRetentionSettings, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResultRetentionSettings = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4614,23 +4175,27 @@ pub mod result_retention_settings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/resultretentionsettings", self.client.endpoint(), &self.organization, @@ -4638,10 +4203,12 @@ pub mod result_retention_settings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4667,38 +4234,18 @@ pub mod result_retention_settings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ResultRetentionSettings, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResultRetentionSettings = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4733,24 +4280,28 @@ pub mod result_retention_settings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/resultretentionsettings", self.client.endpoint(), &self.organization, @@ -4758,10 +4309,12 @@ pub mod result_retention_settings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4816,38 +4369,15 @@ pub mod test_history { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestHistoryQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4882,24 +4412,28 @@ pub mod test_history { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Results/testhistory", self.client.endpoint(), &self.organization, @@ -4907,10 +4441,12 @@ pub mod test_history { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5035,38 +4571,15 @@ pub mod results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5125,14 +4638,18 @@ pub mod results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(details_to_include) = &this.details_to_include { req.url_mut() @@ -5154,14 +4671,14 @@ pub mod results { .query_pairs_mut() .append_pair("outcomes", outcomes); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/results", self.client.endpoint(), &self.organization, @@ -5170,10 +4687,12 @@ pub mod results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5198,38 +4717,15 @@ pub mod results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5265,24 +4761,28 @@ pub mod results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/results", self.client.endpoint(), &self.organization, @@ -5291,10 +4791,12 @@ pub mod results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5319,38 +4821,15 @@ pub mod results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5386,24 +4865,28 @@ pub mod results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/results", self.client.endpoint(), &self.organization, @@ -5412,10 +4895,12 @@ pub mod results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5440,37 +4925,15 @@ pub mod results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResult = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5512,28 +4975,32 @@ pub mod results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(details_to_include) = &this.details_to_include { req.url_mut() .query_pairs_mut() .append_pair("detailsToInclude", details_to_include); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/results/{}", self.client.endpoint(), &self.organization, @@ -5543,10 +5010,12 @@ pub mod results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5630,40 +5099,20 @@ pub mod iterations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestIterationDetailsModelList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestIterationDetailsModelList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5705,14 +5154,18 @@ pub mod iterations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_action_results) = &this.include_action_results { req.url_mut().query_pairs_mut().append_pair( @@ -5720,14 +5173,14 @@ pub mod iterations { &include_action_results.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/Results/{}/iterations", self.client.endpoint(), &self.organization, @@ -5737,10 +5190,12 @@ pub mod iterations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5766,38 +5221,18 @@ pub mod iterations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestIterationDetailsModel, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestIterationDetailsModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5840,14 +5275,18 @@ pub mod iterations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_action_results) = &this.include_action_results { req.url_mut().query_pairs_mut().append_pair( @@ -5855,14 +5294,14 @@ pub mod iterations { &include_action_results.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/Runs/{}/Results/{}/iterations/{}", self.client.endpoint(), &self.organization, @@ -5873,10 +5312,12 @@ pub mod iterations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5931,23 +5372,10 @@ pub mod test_cases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5982,23 +5410,27 @@ pub mod test_cases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/test/testcases/{}", self.client.endpoint(), &self.organization, @@ -6007,10 +5439,12 @@ pub mod test_cases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6116,38 +5550,15 @@ pub mod session { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSessionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6215,14 +5626,18 @@ pub mod session { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(period) = &this.period { req.url_mut() @@ -6253,14 +5668,14 @@ pub mod session { &include_only_completed_sessions.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/test/session", self.client.endpoint(), &self.organization, @@ -6269,10 +5684,12 @@ pub mod session { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6297,37 +5714,15 @@ pub mod session { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSession = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6363,24 +5758,28 @@ pub mod session { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/test/session", self.client.endpoint(), &self.organization, @@ -6389,10 +5788,12 @@ pub mod session { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6417,37 +5818,15 @@ pub mod session { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSession = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6483,24 +5862,28 @@ pub mod session { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/test/session", self.client.endpoint(), &self.organization, @@ -6509,10 +5892,12 @@ pub mod session { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/test/models.rs b/azure_devops_rust_api/src/test/models.rs index 84ac5100..b8ca45c7 100644 --- a/azure_devops_rust_api/src/test/models.rs +++ b/azure_devops_rust_api/src/test/models.rs @@ -421,7 +421,7 @@ pub struct BatchResponse { pub error: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub responses: Vec, @@ -636,7 +636,7 @@ pub struct BuildCoverage { #[doc = "List of Modules"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub modules: Vec, @@ -655,7 +655,7 @@ pub struct BuildCoverageList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -806,7 +806,7 @@ pub struct BulkResultUpdateRequest { pub project_name: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub requests: Vec, @@ -1077,7 +1077,7 @@ pub struct CodeCoverageData { #[serde( rename = "coverageStats", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub coverage_stats: Vec, @@ -1128,7 +1128,7 @@ pub struct CodeCoverageSummary { #[serde( rename = "coverageData", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub coverage_data: Vec, @@ -1328,7 +1328,7 @@ pub struct CreateTestMessageLogEntryRequest { #[serde( rename = "testMessageLogEntry", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_message_log_entry: Vec, @@ -1350,7 +1350,7 @@ pub struct CreateTestResultsRequest { pub project_name: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -1370,7 +1370,7 @@ pub struct CreateTestRunRequest { pub project_name: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -1499,7 +1499,7 @@ pub struct DeleteTestRunRequest { #[serde( rename = "testRunIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_run_ids: Vec, @@ -1513,13 +1513,13 @@ impl DeleteTestRunRequest { pub struct DownloadAttachmentsRequest { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ids: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub lengths: Vec, @@ -1583,7 +1583,7 @@ pub struct FetchTestResultsRequest { #[serde( rename = "idAndRevs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub id_and_revs: Vec, @@ -1610,33 +1610,33 @@ pub struct FetchTestResultsResponse { #[serde( rename = "actionResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub action_results: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub attachments: Vec, #[serde( rename = "deletedIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub deleted_ids: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, #[serde( rename = "testParameters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_parameters: Vec, @@ -1655,7 +1655,7 @@ pub struct FieldDetailsForTestResults { #[serde( rename = "groupsForField", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub groups_for_field: Vec, @@ -1671,7 +1671,7 @@ pub struct FileCoverage { #[serde( rename = "lineBlocksCoverage", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub line_blocks_coverage: Vec, @@ -1721,21 +1721,21 @@ pub struct FilterPointQuery { #[serde( rename = "pointIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub point_ids: Vec, #[serde( rename = "pointOutcome", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub point_outcome: Vec, #[serde( rename = "resultState", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub result_state: Vec, @@ -1783,7 +1783,7 @@ pub struct FlakyDetectionPipelines { #[serde( rename = "allowedPipelines", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub allowed_pipelines: Vec, @@ -2355,7 +2355,7 @@ pub struct LegacyTestCaseResult { #[serde( rename = "customFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub custom_fields: Vec, @@ -2633,7 +2633,7 @@ pub struct LegacyTestRun { #[serde( rename = "configurationIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub configuration_ids: Vec, @@ -2661,7 +2661,7 @@ pub struct LegacyTestRun { #[serde( rename = "customFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub custom_fields: Vec, @@ -2799,7 +2799,7 @@ pub struct LegacyTestRun { #[serde( rename = "rowVersion", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub row_version: Vec, @@ -2871,7 +2871,7 @@ pub struct LegacyTestRun { #[serde( rename = "testMessageLogEntries", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_message_log_entries: Vec, @@ -2892,7 +2892,7 @@ pub struct LegacyTestRun { #[serde( rename = "testRunStatistics", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_run_statistics: Vec, @@ -3004,7 +3004,7 @@ pub struct LegacyTestSettings { #[serde( rename = "machineRoles", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub machine_roles: Vec, @@ -3048,7 +3048,7 @@ pub struct LinkedWorkItemsQuery { #[serde( rename = "automatedTestNames", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub automated_test_names: Vec, @@ -3057,21 +3057,21 @@ pub struct LinkedWorkItemsQuery { #[serde( rename = "pointIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub point_ids: Vec, #[serde( rename = "suiteIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub suite_ids: Vec, #[serde( rename = "testCaseIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_case_ids: Vec, @@ -3110,7 +3110,7 @@ pub struct LinkedWorkItemsQueryResult { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec, @@ -3131,7 +3131,7 @@ pub struct ModuleCoverage { #[serde( rename = "blockData", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub block_data: Vec, @@ -3140,7 +3140,7 @@ pub struct ModuleCoverage { pub file_url: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub functions: Vec, @@ -3173,7 +3173,7 @@ pub struct ModuleCoverage2 { #[serde( rename = "blockData", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub block_data: Vec, @@ -3360,7 +3360,7 @@ pub struct PipelineTestMetrics { #[serde( rename = "summaryAtChild", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub summary_at_child: Vec, @@ -3390,7 +3390,7 @@ pub struct PlanUpdateModel { #[serde( rename = "configurationIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub configuration_ids: Vec, @@ -3505,7 +3505,7 @@ pub struct PointsFilter { #[serde( rename = "configurationNames", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub configuration_names: Vec, @@ -3513,14 +3513,14 @@ pub struct PointsFilter { #[serde( rename = "testcaseIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub testcase_ids: Vec, #[doc = "List of tester for filtering."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub testers: Vec, @@ -3708,21 +3708,21 @@ pub struct QueryTestActionResultResponse { #[serde( rename = "testActionResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_action_results: Vec, #[serde( rename = "testAttachments", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_attachments: Vec, #[serde( rename = "testResultParameters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_result_parameters: Vec, @@ -4042,7 +4042,7 @@ impl RequirementsToTestsMapping2 { pub struct ResetTestResultsRequest { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ids: Vec, @@ -4232,40 +4232,40 @@ pub struct ResultUpdateRequest { #[serde( rename = "actionResultDeletes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub action_result_deletes: Vec, #[serde( rename = "actionResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub action_results: Vec, #[serde( rename = "attachmentDeletes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub attachment_deletes: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub attachments: Vec, #[serde( rename = "parameterDeletes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub parameter_deletes: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub parameters: Vec, @@ -4294,27 +4294,27 @@ pub struct ResultUpdateRequestModel { #[serde( rename = "actionResultDeletes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub action_result_deletes: Vec, #[serde( rename = "actionResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub action_results: Vec, #[serde( rename = "parameterDeletes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub parameter_deletes: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub parameters: Vec, @@ -4335,7 +4335,7 @@ pub struct ResultUpdateResponse { #[serde( rename = "attachmentIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub attachment_ids: Vec, @@ -4439,14 +4439,14 @@ pub struct ResultsByQueryResponse { #[serde( rename = "excessIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub excess_ids: Vec, #[serde( rename = "testResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_results: Vec, @@ -4496,7 +4496,7 @@ pub struct ResultsFilter { #[serde( rename = "testCaseReferenceIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_case_reference_ids: Vec, @@ -4509,7 +4509,7 @@ pub struct ResultsFilter { #[serde( rename = "testPointIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_point_ids: Vec, @@ -4647,7 +4647,7 @@ pub struct RunCreateModel { #[serde( rename = "configurationIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub configuration_ids: Vec, @@ -4658,7 +4658,7 @@ pub struct RunCreateModel { #[serde( rename = "customTestFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub custom_test_fields: Vec, @@ -4718,7 +4718,7 @@ pub struct RunCreateModel { #[serde( rename = "pointIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub point_ids: Vec, @@ -4747,7 +4747,7 @@ pub struct RunCreateModel { #[serde( rename = "runSummary", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub run_summary: Vec, @@ -4774,7 +4774,7 @@ pub struct RunCreateModel { #[doc = "Tags to attach with the test run, maximum of 5 tags can be added to run."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -5061,7 +5061,7 @@ pub struct RunUpdateModel { #[serde( rename = "logEntries", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub log_entries: Vec, @@ -5086,7 +5086,7 @@ pub struct RunUpdateModel { #[serde( rename = "runSummary", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub run_summary: Vec, @@ -5113,7 +5113,7 @@ pub struct RunUpdateModel { #[doc = "Tags to attach with the test run."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -5216,7 +5216,7 @@ pub struct ShallowTestCaseResult { pub run_id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -5279,7 +5279,7 @@ pub struct SuiteCreateModel { #[serde( rename = "requirementIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub requirement_ids: Vec, @@ -5362,7 +5362,7 @@ pub struct SuiteTestCase { #[serde( rename = "pointAssignments", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub point_assignments: Vec, @@ -5381,7 +5381,7 @@ pub struct SuiteTestCaseList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -5397,7 +5397,7 @@ pub struct SuiteTestCaseUpdateModel { #[doc = "Shallow reference of configurations for the test cases in the suite."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub configurations: Vec, @@ -5414,7 +5414,7 @@ pub struct SuiteUpdateModel { #[serde( rename = "defaultConfigurations", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub default_configurations: Vec, @@ -5422,7 +5422,7 @@ pub struct SuiteUpdateModel { #[serde( rename = "defaultTesters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub default_testers: Vec, @@ -5846,7 +5846,7 @@ pub struct TestAttachmentList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -5992,7 +5992,7 @@ pub struct TestCaseReference2 { #[serde( rename = "automatedTestNameHash", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub automated_test_name_hash: Vec, @@ -6005,7 +6005,7 @@ pub struct TestCaseReference2 { #[serde( rename = "automatedTestStorageHash", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub automated_test_storage_hash: Vec, @@ -6096,7 +6096,7 @@ pub struct TestCaseResult { #[serde( rename = "associatedBugs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub associated_bugs: Vec, @@ -6178,7 +6178,7 @@ pub struct TestCaseResult { #[serde( rename = "customFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub custom_fields: Vec, @@ -6217,7 +6217,7 @@ pub struct TestCaseResult { #[serde( rename = "iterationDetails", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub iteration_details: Vec, @@ -6311,7 +6311,7 @@ pub struct TestCaseResult { #[serde( rename = "subResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub sub_results: Vec, @@ -6449,7 +6449,7 @@ pub struct TestCaseResultList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -6464,7 +6464,7 @@ pub struct TestCaseResultUpdateModel { #[serde( rename = "associatedWorkItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub associated_work_items: Vec, @@ -6491,7 +6491,7 @@ pub struct TestCaseResultUpdateModel { #[serde( rename = "customFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub custom_fields: Vec, @@ -6605,7 +6605,7 @@ pub struct TestConfiguration { #[doc = "Dictionary of Test Variable, Selected Value"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -6654,7 +6654,7 @@ pub struct TestExecutionReportData { #[serde( rename = "reportData", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub report_data: Vec, @@ -6783,7 +6783,7 @@ pub struct TestFailureDetails { #[serde( rename = "testResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_results: Vec, @@ -6954,7 +6954,7 @@ pub struct TestHistoryQuery { #[serde( rename = "resultsForGroup", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results_for_group: Vec, @@ -6992,14 +6992,14 @@ pub struct TestIterationDetailsModel { #[serde( rename = "actionResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub action_results: Vec, #[doc = "Reference to attachments in test iteration result."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub attachments: Vec, @@ -7037,7 +7037,7 @@ pub struct TestIterationDetailsModel { #[doc = "Test parameters in an iteration."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub parameters: Vec, @@ -7064,7 +7064,7 @@ pub struct TestIterationDetailsModelList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -7516,7 +7516,7 @@ pub struct TestParameter2 { pub action_path: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub actual: Vec, @@ -7538,7 +7538,7 @@ pub struct TestParameter2 { pub date_modified: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub expected: Vec, @@ -7680,7 +7680,7 @@ pub struct TestPlanCloneRequest { #[serde( rename = "suiteIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub suite_ids: Vec, @@ -7704,14 +7704,14 @@ pub struct TestPlanHubData { #[serde( rename = "testPoints", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_points: Vec, #[serde( rename = "testSuites", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_suites: Vec, @@ -7743,7 +7743,7 @@ pub struct TestPlansWithSelection { pub last_selected_suite: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub plans: Vec, @@ -7870,7 +7870,7 @@ pub struct TestPoint { #[serde( rename = "workItemProperties", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_properties: Vec, @@ -7886,7 +7886,7 @@ pub struct TestPointList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -7937,7 +7937,7 @@ pub struct TestPointsEvent { #[serde( rename = "testPoints", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_points: Vec, @@ -7956,7 +7956,7 @@ pub struct TestPointsQuery { #[doc = "List of test points"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub points: Vec, @@ -7971,7 +7971,7 @@ pub struct TestPointsQuery { #[serde( rename = "witFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub wit_fields: Vec, @@ -8242,7 +8242,7 @@ pub struct TestResultCreateModel { #[serde( rename = "associatedWorkItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub associated_work_items: Vec, @@ -8296,7 +8296,7 @@ pub struct TestResultCreateModel { #[serde( rename = "customFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub custom_fields: Vec, @@ -8449,7 +8449,7 @@ pub struct TestResultHistory { #[serde( rename = "resultsForGroup", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results_for_group: Vec, @@ -8500,7 +8500,7 @@ pub struct TestResultHistoryForGroup { #[doc = "List of results for GroupByValue"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -8531,7 +8531,7 @@ pub struct TestResultMetaData { #[serde( rename = "flakyIdentifiers", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub flaky_identifiers: Vec, @@ -8568,7 +8568,7 @@ pub struct TestResultMetaDataUpdateInput { #[serde( rename = "flakyIdentifiers", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub flaky_identifiers: Vec, @@ -8642,13 +8642,13 @@ pub struct TestResultParameter { pub action_path: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub actual: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub expected: Vec, @@ -8763,7 +8763,7 @@ pub struct TestResultReset2 { #[serde( rename = "testResultRV", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_result_rv: Vec, @@ -8825,7 +8825,7 @@ pub struct TestResultTrendFilter { #[serde( rename = "branchNames", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub branch_names: Vec, @@ -8838,14 +8838,14 @@ pub struct TestResultTrendFilter { #[serde( rename = "definitionIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub definition_ids: Vec, #[serde( rename = "envDefinitionIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub env_definition_ids: Vec, @@ -8865,7 +8865,7 @@ pub struct TestResultTrendFilter { #[serde( rename = "testRunTitles", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_run_titles: Vec, @@ -8927,7 +8927,7 @@ pub struct TestResultsDetails { #[serde( rename = "resultsForGroup", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results_for_group: Vec, @@ -8947,7 +8947,7 @@ pub struct TestResultsDetailsForGroup { pub group_by_value: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -8959,7 +8959,7 @@ pub struct TestResultsDetailsForGroup { pub results_count_by_outcome: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -9031,7 +9031,7 @@ pub struct TestResultsGroupsForBuild { #[doc = "The group by results"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub fields: Vec, @@ -9046,7 +9046,7 @@ pub struct TestResultsGroupsForRelease { #[doc = "The group by results"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub fields: Vec, @@ -9070,13 +9070,13 @@ impl TestResultsGroupsForRelease { pub struct TestResultsQuery { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub fields: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -9144,7 +9144,7 @@ pub struct TestResultsWithWatermark { #[serde( rename = "pointsResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub points_results: Vec, @@ -9197,7 +9197,7 @@ pub struct TestRun { #[serde( rename = "customFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub custom_fields: Vec, @@ -9346,7 +9346,7 @@ pub struct TestRun { #[serde( rename = "runStatistics", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub run_statistics: Vec, @@ -9367,7 +9367,7 @@ pub struct TestRun { #[doc = "Tags attached with this test run."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -9721,7 +9721,7 @@ pub struct TestRunCoverage { #[doc = "List of Modules Coverage"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub modules: Vec, @@ -9743,7 +9743,7 @@ pub struct TestRunCoverageList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -9884,7 +9884,7 @@ pub struct TestRunList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -9913,7 +9913,7 @@ pub struct TestRunStatistic { #[serde( rename = "runStatistics", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub run_statistics: Vec, @@ -9987,7 +9987,7 @@ pub struct TestRunWithDtlEnvEvent { #[serde( rename = "configurationIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub configuration_ids: Vec, @@ -10135,7 +10135,7 @@ pub struct TestSessionExploredWorkItemReference { #[serde( rename = "associatedWorkItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub associated_work_items: Vec, @@ -10167,7 +10167,7 @@ pub struct TestSessionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -10349,7 +10349,7 @@ pub struct TestSubResult { #[serde( rename = "customFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub custom_fields: Vec, @@ -10424,7 +10424,7 @@ pub struct TestSubResult { #[serde( rename = "subResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub sub_results: Vec, @@ -10470,7 +10470,7 @@ pub struct TestSuite { #[doc = "Child test suites of current test suite."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub children: Vec, @@ -10478,7 +10478,7 @@ pub struct TestSuite { #[serde( rename = "defaultConfigurations", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub default_configurations: Vec, @@ -10486,7 +10486,7 @@ pub struct TestSuite { #[serde( rename = "defaultTesters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub default_testers: Vec, @@ -10560,7 +10560,7 @@ pub struct TestSuite { #[doc = "List of shallow reference of suites."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub suites: Vec, @@ -10669,7 +10669,7 @@ impl TestTagSummary { pub struct TestTagsUpdateModel { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -10686,7 +10686,7 @@ pub struct TestToWorkItemLinks { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec, @@ -10719,7 +10719,7 @@ pub struct TestVariable { #[doc = "List of allowed values"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -10734,14 +10734,14 @@ pub struct UpdateTestRunRequest { #[serde( rename = "attachmentsToAdd", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub attachments_to_add: Vec, #[serde( rename = "attachmentsToDelete", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub attachments_to_delete: Vec, @@ -10770,7 +10770,7 @@ pub struct UpdateTestRunResponse { #[serde( rename = "attachmentIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub attachment_ids: Vec, @@ -10821,7 +10821,7 @@ impl UpdatedProperties { pub struct UploadAttachmentsRequest { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub attachments: Vec, @@ -10896,7 +10896,7 @@ pub struct WorkItemToTestLinks { pub executed_in: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tests: Vec, diff --git a/azure_devops_rust_api/src/test_plan/mod.rs b/azure_devops_rust_api/src/test_plan/mod.rs index c88a1b5f..cc720df8 100644 --- a/azure_devops_rust_api/src/test_plan/mod.rs +++ b/azure_devops_rust_api/src/test_plan/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -336,23 +337,10 @@ pub mod suite_test_case { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -389,27 +377,31 @@ pub mod suite_test_case { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_case_ids = &this.test_case_ids; req.url_mut() .query_pairs_mut() .append_pair("testCaseIds", test_case_ids); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase?testCaseIds={}", self.client.endpoint(), &self.organization, @@ -420,10 +412,12 @@ pub mod suite_test_case { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -451,37 +445,15 @@ pub mod suite_test_case { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -564,14 +536,18 @@ pub mod suite_test_case { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(test_ids) = &this.test_ids { req.url_mut() @@ -613,14 +589,14 @@ pub mod suite_test_case { .query_pairs_mut() .append_pair("isRecursive", &is_recursive.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", self.client.endpoint(), &self.organization, @@ -630,10 +606,12 @@ pub mod suite_test_case { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -658,37 +636,15 @@ pub mod suite_test_case { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -725,24 +681,28 @@ pub mod suite_test_case { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", self.client.endpoint(), &self.organization, @@ -752,10 +712,12 @@ pub mod suite_test_case { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -780,37 +742,15 @@ pub mod suite_test_case { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -847,24 +787,28 @@ pub mod suite_test_case { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", self.client.endpoint(), &self.organization, @@ -874,10 +818,12 @@ pub mod suite_test_case { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -902,23 +848,10 @@ pub mod suite_test_case { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -955,27 +888,31 @@ pub mod suite_test_case { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_ids = &this.test_ids; req.url_mut() .query_pairs_mut() .append_pair("testIds", test_ids); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", self.client.endpoint(), &self.organization, @@ -985,10 +922,12 @@ pub mod suite_test_case { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1016,37 +955,15 @@ pub mod suite_test_case { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1095,14 +1012,18 @@ pub mod suite_test_case { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(wit_fields) = &this.wit_fields { req.url_mut() @@ -1114,14 +1035,14 @@ pub mod suite_test_case { .query_pairs_mut() .append_pair("returnIdentityRef", &return_identity_ref.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase/{}", self.client.endpoint(), &self.organization, @@ -1132,10 +1053,12 @@ pub mod suite_test_case { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1252,37 +1175,15 @@ pub mod test_point { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1354,14 +1255,18 @@ pub mod test_point { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(test_point_ids) = &this.test_point_ids { req.url_mut() @@ -1394,14 +1299,14 @@ pub mod test_point { .query_pairs_mut() .append_pair("isRecursive", &is_recursive.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint?", self.client.endpoint(), &self.organization, @@ -1411,10 +1316,12 @@ pub mod test_point { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1439,37 +1346,15 @@ pub mod test_point { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1518,14 +1403,18 @@ pub mod test_point { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let point_id = &this.point_id; req.url_mut() @@ -1542,14 +1431,14 @@ pub mod test_point { &include_point_details.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint", self.client.endpoint(), &self.organization, @@ -1559,10 +1448,12 @@ pub mod test_point { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1587,37 +1478,15 @@ pub mod test_point { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1666,17 +1535,21 @@ pub mod test_point { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(include_point_details) = &this.include_point_details { req.url_mut().query_pairs_mut().append_pair( "includePointDetails", @@ -1689,12 +1562,12 @@ pub mod test_point { .append_pair("returnIdentityRef", &return_identity_ref.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint", self.client.endpoint(), &self.organization, @@ -1704,10 +1577,12 @@ pub mod test_point { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1872,37 +1747,15 @@ pub mod test_suites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSuiteList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1936,37 +1789,43 @@ pub mod test_suites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_case_id = &this.test_case_id; req.url_mut() .query_pairs_mut() .append_pair("testCaseId", &test_case_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/testplan/suites", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1991,37 +1850,15 @@ pub mod test_suites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSuiteList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2074,14 +1911,18 @@ pub mod test_suites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() @@ -2098,14 +1939,14 @@ pub mod test_suites { .query_pairs_mut() .append_pair("asTreeView", &as_tree_view.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/suites", self.client.endpoint(), &self.organization, @@ -2114,10 +1955,12 @@ pub mod test_suites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2142,37 +1985,15 @@ pub mod test_suites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSuite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2208,24 +2029,28 @@ pub mod test_suites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/suites", self.client.endpoint(), &self.organization, @@ -2234,10 +2059,12 @@ pub mod test_suites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2262,37 +2089,15 @@ pub mod test_suites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSuite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2334,28 +2139,32 @@ pub mod test_suites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", self.client.endpoint(), &self.organization, @@ -2365,10 +2174,12 @@ pub mod test_suites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2393,37 +2204,15 @@ pub mod test_suites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSuite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2460,24 +2249,28 @@ pub mod test_suites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", self.client.endpoint(), &self.organization, @@ -2487,10 +2280,12 @@ pub mod test_suites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2515,23 +2310,10 @@ pub mod test_suites { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2567,23 +2349,27 @@ pub mod test_suites { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", self.client.endpoint(), &self.organization, @@ -2593,10 +2379,12 @@ pub mod test_suites { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2730,38 +2518,15 @@ pub mod configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestConfigurationList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2801,28 +2566,32 @@ pub mod configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(continuation_token) = &this.continuation_token { req.url_mut() .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/configurations", self.client.endpoint(), &self.organization, @@ -2830,10 +2599,12 @@ pub mod configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2858,38 +2629,15 @@ pub mod configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2924,24 +2672,28 @@ pub mod configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/configurations", self.client.endpoint(), &self.organization, @@ -2949,10 +2701,12 @@ pub mod configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2977,38 +2731,15 @@ pub mod configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3044,28 +2775,32 @@ pub mod configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let test_configuartion_id = &this.test_configuartion_id; req.url_mut() .query_pairs_mut() .append_pair("testConfiguartionId", &test_configuartion_id.to_string()); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/configurations", self.client.endpoint(), &self.organization, @@ -3073,10 +2808,12 @@ pub mod configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3101,23 +2838,10 @@ pub mod configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3152,27 +2876,31 @@ pub mod configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_configuartion_id = &this.test_configuartion_id; req.url_mut() .query_pairs_mut() .append_pair("testConfiguartionId", &test_configuartion_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/configurations", self.client.endpoint(), &self.organization, @@ -3180,10 +2908,12 @@ pub mod configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3211,38 +2941,15 @@ pub mod configurations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3277,23 +2984,27 @@ pub mod configurations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/configurations/{}", self.client.endpoint(), &self.organization, @@ -3302,10 +3013,12 @@ pub mod configurations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3439,37 +3152,15 @@ pub mod test_plans { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPlanList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3527,14 +3218,18 @@ pub mod test_plans { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(owner) = &this.owner { req.url_mut().query_pairs_mut().append_pair("owner", owner); @@ -3555,14 +3250,14 @@ pub mod test_plans { .query_pairs_mut() .append_pair("filterActivePlans", &filter_active_plans.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/plans", self.client.endpoint(), &self.organization, @@ -3570,10 +3265,12 @@ pub mod test_plans { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3598,37 +3295,15 @@ pub mod test_plans { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPlan = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3663,24 +3338,28 @@ pub mod test_plans { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/plans", self.client.endpoint(), &self.organization, @@ -3688,10 +3367,12 @@ pub mod test_plans { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3716,37 +3397,15 @@ pub mod test_plans { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPlan = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3781,23 +3440,27 @@ pub mod test_plans { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/plans/{}", self.client.endpoint(), &self.organization, @@ -3806,10 +3469,12 @@ pub mod test_plans { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3834,37 +3499,15 @@ pub mod test_plans { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPlan = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3900,24 +3543,28 @@ pub mod test_plans { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/plans/{}", self.client.endpoint(), &self.organization, @@ -3926,10 +3573,12 @@ pub mod test_plans { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3954,23 +3603,10 @@ pub mod test_plans { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4005,23 +3641,27 @@ pub mod test_plans { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/plans/{}", self.client.endpoint(), &self.organization, @@ -4030,10 +3670,12 @@ pub mod test_plans { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4110,40 +3752,20 @@ pub mod test_plan_clone { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::CloneTestPlanOperationInformation, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CloneTestPlanOperationInformation = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4184,29 +3806,33 @@ pub mod test_plan_clone { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(deep_clone) = &this.deep_clone { req.url_mut() .query_pairs_mut() .append_pair("deepClone", &deep_clone.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/CloneOperation", self.client.endpoint(), &self.organization, @@ -4214,10 +3840,12 @@ pub mod test_plan_clone { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4243,40 +3871,20 @@ pub mod test_plan_clone { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::CloneTestPlanOperationInformation, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CloneTestPlanOperationInformation = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4311,23 +3919,27 @@ pub mod test_plan_clone { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Plans/CloneOperation/{}", self.client.endpoint(), &self.organization, @@ -4336,10 +3948,12 @@ pub mod test_plan_clone { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4417,37 +4031,15 @@ pub mod test_suite_entry { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SuiteEntryList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4487,28 +4079,32 @@ pub mod test_suite_entry { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(suite_entry_type) = &this.suite_entry_type { req.url_mut() .query_pairs_mut() .append_pair("suiteEntryType", suite_entry_type); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/suiteentry/{}", self.client.endpoint(), &self.organization, @@ -4517,10 +4113,12 @@ pub mod test_suite_entry { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4545,37 +4143,15 @@ pub mod test_suite_entry { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SuiteEntryList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4611,24 +4187,28 @@ pub mod test_suite_entry { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/suiteentry/{}", self.client.endpoint(), &self.organization, @@ -4637,10 +4217,12 @@ pub mod test_suite_entry { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4714,40 +4296,20 @@ pub mod test_suite_clone { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::CloneTestSuiteOperationInformation, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CloneTestSuiteOperationInformation = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4788,29 +4350,33 @@ pub mod test_suite_clone { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(deep_clone) = &this.deep_clone { req.url_mut() .query_pairs_mut() .append_pair("deepClone", &deep_clone.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Suites/CloneOperation", self.client.endpoint(), &self.organization, @@ -4818,10 +4384,12 @@ pub mod test_suite_clone { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4847,40 +4415,20 @@ pub mod test_suite_clone { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::CloneTestSuiteOperationInformation, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CloneTestSuiteOperationInformation = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4915,23 +4463,27 @@ pub mod test_suite_clone { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/Suites/CloneOperation/{}", self.client.endpoint(), &self.organization, @@ -4940,10 +4492,12 @@ pub mod test_suite_clone { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4998,23 +4552,10 @@ pub mod test_cases { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5049,23 +4590,27 @@ pub mod test_cases { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/testcases/{}", self.client.endpoint(), &self.organization, @@ -5074,10 +4619,12 @@ pub mod test_cases { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5150,40 +4697,20 @@ pub mod test_case_clone { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::CloneTestCaseOperationInformation, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CloneTestCaseOperationInformation = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5218,24 +4745,28 @@ pub mod test_case_clone { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/TestCases/CloneTestCaseOperation", self.client.endpoint(), &self.organization, @@ -5243,10 +4774,12 @@ pub mod test_case_clone { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5272,40 +4805,20 @@ pub mod test_case_clone { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::CloneTestCaseOperationInformation, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CloneTestCaseOperationInformation = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5340,23 +4853,27 @@ pub mod test_case_clone { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/TestCases/CloneTestCaseOperation/{}", self.client.endpoint(), &self.organization, @@ -5365,10 +4882,12 @@ pub mod test_case_clone { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5500,38 +5019,15 @@ pub mod variables { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestVariableList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5571,28 +5067,32 @@ pub mod variables { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(continuation_token) = &this.continuation_token { req.url_mut() .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/variables", self.client.endpoint(), &self.organization, @@ -5600,10 +5100,12 @@ pub mod variables { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5628,37 +5130,15 @@ pub mod variables { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestVariable = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5693,24 +5173,28 @@ pub mod variables { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/variables", self.client.endpoint(), &self.organization, @@ -5718,10 +5202,12 @@ pub mod variables { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5746,37 +5232,15 @@ pub mod variables { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestVariable = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5811,23 +5275,27 @@ pub mod variables { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/variables/{}", self.client.endpoint(), &self.organization, @@ -5836,10 +5304,12 @@ pub mod variables { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5864,37 +5334,15 @@ pub mod variables { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestVariable = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5930,24 +5378,28 @@ pub mod variables { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/variables/{}", self.client.endpoint(), &self.organization, @@ -5956,10 +5408,12 @@ pub mod variables { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5984,23 +5438,10 @@ pub mod variables { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6035,23 +5476,27 @@ pub mod variables { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testplan/variables/{}", self.client.endpoint(), &self.organization, @@ -6060,10 +5505,12 @@ pub mod variables { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/test_plan/models.rs b/azure_devops_rust_api/src/test_plan/models.rs index b95438a8..39f6ff8b 100644 --- a/azure_devops_rust_api/src/test_plan/models.rs +++ b/azure_devops_rust_api/src/test_plan/models.rs @@ -279,7 +279,7 @@ pub struct CloneTestCaseParams { #[serde( rename = "testCaseIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_case_ids: Vec, @@ -482,7 +482,7 @@ pub struct ExportTestCaseParams { #[serde( rename = "testCaseIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_case_ids: Vec, @@ -618,7 +618,7 @@ pub struct LibraryWorkItemsData { #[serde( rename = "columnOptions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub column_options: Vec, @@ -654,7 +654,7 @@ pub struct LibraryWorkItemsData { #[serde( rename = "workItemIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_ids: Vec, @@ -662,7 +662,7 @@ pub struct LibraryWorkItemsData { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec, @@ -690,7 +690,7 @@ pub struct LibraryWorkItemsDataProviderRequest { #[serde( rename = "columnOptions", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub column_options: Vec, @@ -705,7 +705,7 @@ pub struct LibraryWorkItemsDataProviderRequest { #[serde( rename = "filterValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub filter_values: Vec, @@ -734,7 +734,7 @@ pub struct LibraryWorkItemsDataProviderRequest { #[serde( rename = "workItemIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_ids: Vec, @@ -899,7 +899,7 @@ pub struct SourceTestPlanInfo { #[serde( rename = "suiteIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub suite_ids: Vec, @@ -933,7 +933,7 @@ pub struct SourceTestSuiteResponse { #[serde( rename = "testCaseIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_case_ids: Vec, @@ -955,7 +955,7 @@ pub struct SourceTestplanResponse { #[serde( rename = "suiteIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub suite_ids: Vec, @@ -985,7 +985,7 @@ pub struct SuiteEntryList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1039,7 +1039,7 @@ pub struct SuiteTestCaseCreateUpdateParameters { #[serde( rename = "pointAssignments", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub point_assignments: Vec, @@ -1155,7 +1155,7 @@ pub struct TestCase { #[serde( rename = "pointAssignments", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub point_assignments: Vec, @@ -1259,7 +1259,7 @@ pub struct TestCaseList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1305,7 +1305,7 @@ pub struct TestCaseResultsData { #[doc = "Use to store the results displayed in the table"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -1357,7 +1357,7 @@ pub struct TestConfigurationCreateUpdateParameters { #[doc = "Dictionary of Test Variable, Selected Value"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -1384,7 +1384,7 @@ pub struct TestConfigurationList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1633,7 +1633,7 @@ pub struct TestPlanList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1678,7 +1678,7 @@ pub struct TestPlansHubRefreshData { #[serde( rename = "defineColumnOptionFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub define_column_option_fields: Vec, @@ -1697,7 +1697,7 @@ pub struct TestPlansHubRefreshData { #[serde( rename = "executeColumnOptionFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub execute_column_option_fields: Vec, @@ -1734,7 +1734,7 @@ pub struct TestPlansHubRefreshData { #[serde( rename = "testCases", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_cases: Vec, @@ -1756,7 +1756,7 @@ pub struct TestPlansHubRefreshData { #[serde( rename = "testPoints", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_points: Vec, @@ -1769,7 +1769,7 @@ pub struct TestPlansHubRefreshData { #[serde( rename = "testSuites", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_suites: Vec, @@ -1795,7 +1795,7 @@ pub struct TestPlansLibraryWorkItemFilter { #[serde( rename = "fieldValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub field_values: Vec, @@ -1924,7 +1924,7 @@ pub struct TestPointList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2184,7 +2184,7 @@ pub struct TestSuite { #[doc = "Child test suites of current test suite."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub children: Vec, @@ -2281,7 +2281,7 @@ pub struct TestSuiteCreateUpdateCommonParams { #[serde( rename = "defaultConfigurations", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub default_configurations: Vec, @@ -2289,7 +2289,7 @@ pub struct TestSuiteCreateUpdateCommonParams { #[serde( rename = "defaultTesters", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub default_testers: Vec, @@ -2329,7 +2329,7 @@ pub struct TestSuiteList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2411,7 +2411,7 @@ pub struct TestVariableCreateUpdateParameters { #[doc = "List of allowed values"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -2427,7 +2427,7 @@ pub struct TestVariableList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2487,7 +2487,7 @@ pub struct WorkItemDetails { #[serde( rename = "workItemFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_fields: Vec, diff --git a/azure_devops_rust_api/src/test_results/mod.rs b/azure_devops_rust_api/src/test_results/mod.rs index b37a93db..e78d2bc5 100644 --- a/azure_devops_rust_api/src/test_results/mod.rs +++ b/azure_devops_rust_api/src/test_results/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://vstmr.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -335,38 +336,15 @@ pub mod codecoverage { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildCoverageList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -402,14 +380,18 @@ pub mod codecoverage { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build_id = &this.build_id; req.url_mut() @@ -419,14 +401,14 @@ pub mod codecoverage { req.url_mut() .query_pairs_mut() .append_pair("flags", &flags.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/codecoverage?buildId={}&flags={}", self.client.endpoint(), &self.organization, @@ -436,10 +418,12 @@ pub mod codecoverage { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -464,38 +448,15 @@ pub mod codecoverage { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeCoverageSummary = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -535,14 +496,18 @@ pub mod codecoverage { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build_id = &this.build_id; req.url_mut() @@ -553,14 +518,14 @@ pub mod codecoverage { .query_pairs_mut() .append_pair("deltaBuildId", &delta_build_id.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/codecoverage", self.client.endpoint(), &self.organization, @@ -568,10 +533,12 @@ pub mod codecoverage { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -596,23 +563,10 @@ pub mod codecoverage { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -652,14 +606,18 @@ pub mod codecoverage { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build_id = &this.build_id; req.url_mut() @@ -667,17 +625,17 @@ pub mod codecoverage { .append_pair("buildId", &build_id.to_string()); let req_body = if let Some(body) = &this.body { req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? + azure_core::json::to_json(body)? } else { - azure_core::EMPTY_BODY + azure_core::Bytes::new() }; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/codecoverage", self.client.endpoint(), &self.organization, @@ -685,10 +643,12 @@ pub mod codecoverage { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -716,38 +676,15 @@ pub mod codecoverage { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunCoverageList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -783,27 +720,31 @@ pub mod codecoverage { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let flags = &this.flags; req.url_mut() .query_pairs_mut() .append_pair("flags", &flags.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/codecoverage", self.client.endpoint(), &self.organization, @@ -812,10 +753,12 @@ pub mod codecoverage { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -976,37 +919,15 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1126,23 +1047,31 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let min_last_updated_date = &this.min_last_updated_date; + let formatted_date_time = + crate::date_time::format_date_time(min_last_updated_date)?; req.url_mut() .query_pairs_mut() - .append_pair("minLastUpdatedDate", &min_last_updated_date.to_string()); + .append_pair("minLastUpdatedDate", &formatted_date_time); let max_last_updated_date = &this.max_last_updated_date; + let formatted_date_time = + crate::date_time::format_date_time(max_last_updated_date)?; req.url_mut() .query_pairs_mut() - .append_pair("maxLastUpdatedDate", &max_last_updated_date.to_string()); + .append_pair("maxLastUpdatedDate", &formatted_date_time); if let Some(state) = &this.state { req.url_mut().query_pairs_mut().append_pair("state", state); } @@ -1211,14 +1140,14 @@ pub mod runs { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs?minLastUpdatedDate={}&maxLastUpdatedDate={}", self.client.endpoint(), &self.organization, @@ -1228,10 +1157,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1256,37 +1187,15 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1360,14 +1269,18 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(build_uri) = &this.build_uri { req.url_mut() @@ -1407,14 +1320,14 @@ pub mod runs { .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs", self.client.endpoint(), &self.organization, @@ -1422,10 +1335,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1450,37 +1365,15 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRun = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1515,24 +1408,28 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs", self.client.endpoint(), &self.organization, @@ -1540,10 +1437,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1568,37 +1467,15 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRun = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1643,14 +1520,18 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_details) = &this.include_details { req.url_mut() @@ -1662,14 +1543,14 @@ pub mod runs { .query_pairs_mut() .append_pair("includeTags", &include_tags.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}", self.client.endpoint(), &self.organization, @@ -1678,10 +1559,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1706,37 +1589,15 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRun = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1772,24 +1633,28 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}", self.client.endpoint(), &self.organization, @@ -1798,10 +1663,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1826,23 +1693,10 @@ pub mod runs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1877,23 +1731,27 @@ pub mod runs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}", self.client.endpoint(), &self.organization, @@ -1902,10 +1760,12 @@ pub mod runs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2060,37 +1920,15 @@ pub mod testlog { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2158,14 +1996,18 @@ pub mod testlog { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let sub_result_id = &this.sub_result_id; req.url_mut() @@ -2196,14 +2038,14 @@ pub mod testlog { if let Some(continuation_token) = &this.continuation_token { req.insert_header("continuationtoken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlog?subResultId={}&type={}", self.client.endpoint(), &self.organization, @@ -2215,10 +2057,12 @@ pub mod testlog { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2243,37 +2087,15 @@ pub mod testlog { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2340,14 +2162,18 @@ pub mod testlog { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let type_ = &this.type_; req.url_mut().query_pairs_mut().append_pair("type", type_); @@ -2374,14 +2200,14 @@ pub mod testlog { if let Some(continuation_token) = &this.continuation_token { req.insert_header("continuationtoken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlog", self.client.endpoint(), &self.organization, @@ -2391,10 +2217,12 @@ pub mod testlog { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2419,37 +2247,15 @@ pub mod testlog { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2515,14 +2321,18 @@ pub mod testlog { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let type_ = &this.type_; req.url_mut().query_pairs_mut().append_pair("type", type_); @@ -2549,14 +2359,14 @@ pub mod testlog { if let Some(continuation_token) = &this.continuation_token { req.insert_header("continuationtoken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/testlog", self.client.endpoint(), &self.organization, @@ -2565,10 +2375,12 @@ pub mod testlog { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2593,37 +2405,15 @@ pub mod testlog { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2689,14 +2479,18 @@ pub mod testlog { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build_id = &this.build_id; req.url_mut() @@ -2727,14 +2521,14 @@ pub mod testlog { if let Some(continuation_token) = &this.continuation_token { req.insert_header("continuationtoken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/testlog", self.client.endpoint(), &self.organization, @@ -2742,10 +2536,12 @@ pub mod testlog { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2966,40 +2762,20 @@ pub mod testlogstoreendpoint { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestLogStoreEndpointDetails, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreEndpointDetails = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3038,14 +2814,18 @@ pub mod testlogstoreendpoint { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let sub_result_id = &this.sub_result_id; req.url_mut() @@ -3057,20 +2837,22 @@ pub mod testlogstoreendpoint { req.url_mut() .query_pairs_mut() .append_pair("filePath", file_path); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint?subResultId={}&type={}&filePath={}" , self . client . endpoint () , & self . organization , & self . project , & self . run_id , & self . result_id , & self . sub_result_id , & self . type_ , & self . file_path)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint?subResultId={}&type={}&filePath={}" , self . client . endpoint () , & self . organization , & self . project , & self . run_id , & self . result_id , & self . sub_result_id , & self . type_ , & self . file_path)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3096,40 +2878,20 @@ pub mod testlogstoreendpoint { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestLogStoreEndpointDetails, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreEndpointDetails = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3167,14 +2929,18 @@ pub mod testlogstoreendpoint { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let type_ = &this.type_; req.url_mut().query_pairs_mut().append_pair("type", type_); @@ -3182,14 +2948,14 @@ pub mod testlogstoreendpoint { req.url_mut() .query_pairs_mut() .append_pair("filePath", file_path); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint", self.client.endpoint(), &self.organization, @@ -3199,10 +2965,12 @@ pub mod testlogstoreendpoint { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3228,40 +2996,20 @@ pub mod testlogstoreendpoint { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestLogStoreEndpointDetails, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreEndpointDetails = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3300,14 +3048,18 @@ pub mod testlogstoreendpoint { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let sub_result_id = &this.sub_result_id; req.url_mut() @@ -3319,15 +3071,15 @@ pub mod testlogstoreendpoint { .append_pair("filePath", file_path); let type_ = &this.type_; req.url_mut().query_pairs_mut().append_pair("type", type_); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint", self.client.endpoint(), &self.organization, @@ -3337,10 +3089,12 @@ pub mod testlogstoreendpoint { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3366,40 +3120,20 @@ pub mod testlogstoreendpoint { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestLogStoreEndpointDetails, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreEndpointDetails = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3436,14 +3170,18 @@ pub mod testlogstoreendpoint { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let type_ = &this.type_; req.url_mut().query_pairs_mut().append_pair("type", type_); @@ -3451,14 +3189,14 @@ pub mod testlogstoreendpoint { req.url_mut() .query_pairs_mut() .append_pair("filePath", file_path); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/testlogstoreendpoint", self.client.endpoint(), &self.organization, @@ -3467,10 +3205,12 @@ pub mod testlogstoreendpoint { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3496,40 +3236,20 @@ pub mod testlogstoreendpoint { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestLogStoreEndpointDetails, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreEndpointDetails = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3577,14 +3297,18 @@ pub mod testlogstoreendpoint { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_log_store_operation_type = &this.test_log_store_operation_type; req.url_mut().query_pairs_mut().append_pair( @@ -3599,15 +3323,15 @@ pub mod testlogstoreendpoint { if let Some(type_) = &this.type_ { req.url_mut().query_pairs_mut().append_pair("type", type_); } - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/testlogstoreendpoint", self.client.endpoint(), &self.organization, @@ -3616,10 +3340,12 @@ pub mod testlogstoreendpoint { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3645,40 +3371,20 @@ pub mod testlogstoreendpoint { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestLogStoreEndpointDetails, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreEndpointDetails = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3715,14 +3421,18 @@ pub mod testlogstoreendpoint { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build = &this.build; req.url_mut() @@ -3734,14 +3444,14 @@ pub mod testlogstoreendpoint { req.url_mut() .query_pairs_mut() .append_pair("filePath", file_path); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/testlogstoreendpoint", self.client.endpoint(), &self.organization, @@ -3749,10 +3459,12 @@ pub mod testlogstoreendpoint { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3778,40 +3490,20 @@ pub mod testlogstoreendpoint { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestLogStoreEndpointDetails, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreEndpointDetails = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3847,14 +3539,18 @@ pub mod testlogstoreendpoint { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build_id = &this.build_id; req.url_mut() @@ -3865,15 +3561,15 @@ pub mod testlogstoreendpoint { "testLogStoreOperationType", test_log_store_operation_type, ); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/testlogstoreendpoint", self.client.endpoint(), &self.organization, @@ -3881,10 +3577,12 @@ pub mod testlogstoreendpoint { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4187,38 +3885,15 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4255,27 +3930,31 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_sub_result_id = &this.test_sub_result_id; req.url_mut() .query_pairs_mut() .append_pair("testSubResultId", &test_sub_result_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments?testSubResultId={}", self.client.endpoint(), &self.organization, @@ -4286,10 +3965,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4314,38 +3995,18 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestAttachmentReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentReference = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4383,28 +4044,32 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let test_sub_result_id = &this.test_sub_result_id; req.url_mut() .query_pairs_mut() .append_pair("testSubResultId", &test_sub_result_id.to_string()); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments?testSubResultId={}", self.client.endpoint(), &self.organization, @@ -4415,10 +4080,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4444,38 +4111,18 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestAttachmentReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentReference = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4518,17 +4165,21 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let iteration_id = &this.iteration_id; req.url_mut() .query_pairs_mut() @@ -4539,12 +4190,12 @@ pub mod attachments { .append_pair("actionPath", action_path); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments?iterationId={}", self.client.endpoint(), &self.organization, @@ -4555,10 +4206,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4584,37 +4237,13 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4652,33 +4281,39 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_sub_result_id = &this.test_sub_result_id; req.url_mut() .query_pairs_mut() .append_pair("testSubResultId", &test_sub_result_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments/{}?testSubResultId={}" , self . client . endpoint () , & self . organization , & self . project , & self . run_id , & self . test_case_result_id , & self . attachment_id , & self . test_sub_result_id)) ? ; + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments/{}?testSubResultId={}" , self . client . endpoint () , & self . organization , & self . project , & self . run_id , & self . test_case_result_id , & self . attachment_id , & self . test_sub_result_id)) ? ; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4703,37 +4338,13 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4771,27 +4382,31 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let iteration_id = &this.iteration_id; req.url_mut() .query_pairs_mut() .append_pair("iterationId", &iteration_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments/{}?iterationId={}", self.client.endpoint(), &self.organization, @@ -4803,10 +4418,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4831,38 +4448,15 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4897,23 +4491,27 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/attachments", self.client.endpoint(), &self.organization, @@ -4922,10 +4520,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4950,38 +4550,18 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestAttachmentReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentReference = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5017,24 +4597,28 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/attachments", self.client.endpoint(), &self.organization, @@ -5043,10 +4627,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5072,37 +4658,13 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5138,23 +4700,27 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/attachments/{}", self.client.endpoint(), &self.organization, @@ -5164,10 +4730,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5192,23 +4760,10 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5244,23 +4799,27 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/attachments/{}", self.client.endpoint(), &self.organization, @@ -5270,10 +4829,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5301,38 +4862,15 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5368,23 +4906,27 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments", self.client.endpoint(), &self.organization, @@ -5394,10 +4936,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5422,38 +4966,18 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestAttachmentReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentReference = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5490,24 +5014,28 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments", self.client.endpoint(), &self.organization, @@ -5517,10 +5045,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5546,37 +5076,13 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5613,23 +5119,27 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments/{}", self.client.endpoint(), &self.organization, @@ -5640,10 +5150,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5668,23 +5180,10 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5721,23 +5220,27 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments/{}", self.client.endpoint(), &self.organization, @@ -5748,10 +5251,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5896,37 +5401,13 @@ pub mod testattachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5962,27 +5443,31 @@ pub mod testattachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let filename = &this.filename; req.url_mut() .query_pairs_mut() .append_pair("filename", filename); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/testattachments?filename={}", self.client.endpoint(), &self.organization, @@ -5992,10 +5477,12 @@ pub mod testattachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6020,38 +5507,18 @@ pub mod testattachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestLogStoreAttachmentList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreAttachmentList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6086,23 +5553,27 @@ pub mod testattachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/testattachments", self.client.endpoint(), &self.organization, @@ -6111,10 +5582,12 @@ pub mod testattachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6140,40 +5613,20 @@ pub mod testattachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestLogStoreAttachmentReference, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreAttachmentReference = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6209,24 +5662,28 @@ pub mod testattachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/testattachments", self.client.endpoint(), &self.organization, @@ -6235,10 +5692,12 @@ pub mod testattachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6264,23 +5723,10 @@ pub mod testattachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6316,27 +5762,31 @@ pub mod testattachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let filename = &this.filename; req.url_mut() .query_pairs_mut() .append_pair("filename", filename); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/testattachments", self.client.endpoint(), &self.organization, @@ -6345,10 +5795,12 @@ pub mod testattachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6376,23 +5828,10 @@ pub mod testattachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6428,24 +5867,28 @@ pub mod testattachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/uploadbuildattachments/{}", self.client.endpoint(), &self.organization, @@ -6454,10 +5897,12 @@ pub mod testattachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6547,37 +5992,15 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestTagList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6613,14 +6036,18 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let release_id = &this.release_id; req.url_mut() @@ -6630,14 +6057,14 @@ pub mod tags { req.url_mut() .query_pairs_mut() .append_pair("releaseEnvId", &release_env_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/tags?releaseId={}&releaseEnvId={}", self.client.endpoint(), &self.organization, @@ -6647,10 +6074,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6675,37 +6104,15 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestTagList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6741,24 +6148,28 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/tags", self.client.endpoint(), &self.organization, @@ -6767,10 +6178,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6795,37 +6208,15 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestTagList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6860,27 +6251,31 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build_id = &this.build_id; req.url_mut() .query_pairs_mut() .append_pair("buildId", &build_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/tags", self.client.endpoint(), &self.organization, @@ -6888,10 +6283,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6960,37 +6357,15 @@ pub mod tagsummary { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestTagSummary = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7026,14 +6401,18 @@ pub mod tagsummary { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let release_id = &this.release_id; req.url_mut() @@ -7043,14 +6422,14 @@ pub mod tagsummary { req.url_mut() .query_pairs_mut() .append_pair("releaseEnvId", &release_env_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/tagsummary?releaseId={}&releaseEnvId={}", self.client.endpoint(), &self.organization, @@ -7060,10 +6439,12 @@ pub mod tagsummary { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7088,37 +6469,15 @@ pub mod tagsummary { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestTagSummary = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7153,27 +6512,31 @@ pub mod tagsummary { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build_id = &this.build_id; req.url_mut() .query_pairs_mut() .append_pair("buildId", &build_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/tagsummary", self.client.endpoint(), &self.organization, @@ -7181,10 +6544,12 @@ pub mod tagsummary { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7311,38 +6676,15 @@ pub mod workitems { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestToWorkItemLinks = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7377,28 +6719,32 @@ pub mod workitems { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_name = &this.test_name; req.url_mut() .query_pairs_mut() .append_pair("testName", test_name); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/testmethods/workitems?testName={}", self.client.endpoint(), &self.organization, @@ -7407,10 +6753,12 @@ pub mod workitems { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7435,38 +6783,15 @@ pub mod workitems { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemReferenceList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7529,14 +6854,18 @@ pub mod workitems { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let work_item_category = &this.work_item_category; req.url_mut() @@ -7553,9 +6882,11 @@ pub mod workitems { .append_pair("testCaseId", &test_case_id.to_string()); } if let Some(max_complete_date) = &this.max_complete_date { + let formatted_date_time = + crate::date_time::format_date_time(max_complete_date)?; req.url_mut() .query_pairs_mut() - .append_pair("maxCompleteDate", &max_complete_date.to_string()); + .append_pair("maxCompleteDate", &formatted_date_time); } if let Some(days) = &this.days { req.url_mut() @@ -7567,14 +6898,14 @@ pub mod workitems { .query_pairs_mut() .append_pair("$workItemCount", &work_item_count.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/results/workitems", self.client.endpoint(), &self.organization, @@ -7582,10 +6913,12 @@ pub mod workitems { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7610,38 +6943,15 @@ pub mod workitems { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemReferenceList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7677,23 +6987,27 @@ pub mod workitems { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/workitems", self.client.endpoint(), &self.organization, @@ -7703,10 +7017,12 @@ pub mod workitems { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7731,38 +7047,15 @@ pub mod workitems { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemToTestLinks = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7797,24 +7090,28 @@ pub mod workitems { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/testmethods/workitems", self.client.endpoint(), &self.organization, @@ -7822,10 +7119,12 @@ pub mod workitems { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7850,37 +7149,13 @@ pub mod workitems { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: bool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7916,14 +7191,18 @@ pub mod workitems { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_name = &this.test_name; req.url_mut() @@ -7933,14 +7212,14 @@ pub mod workitems { req.url_mut() .query_pairs_mut() .append_pair("workItemId", &work_item_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/testmethods/workitems", self.client.endpoint(), &self.organization, @@ -7948,10 +7227,12 @@ pub mod workitems { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8005,37 +7286,13 @@ pub mod filecoverage { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8070,24 +7327,28 @@ pub mod filecoverage { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/codecoverage/filecoverage", self.client.endpoint(), &self.organization, @@ -8095,10 +7356,12 @@ pub mod filecoverage { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8154,37 +7417,13 @@ pub mod status { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8231,14 +7470,18 @@ pub mod status { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(branch_name) = &this.branch_name { req.url_mut() @@ -8248,14 +7491,14 @@ pub mod status { if let Some(label) = &this.label { req.url_mut().query_pairs_mut().append_pair("label", label); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/codecoverage/status/{}", self.client.endpoint(), &self.organization, @@ -8264,10 +7507,12 @@ pub mod status { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8326,38 +7571,15 @@ pub mod metrics { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PipelineTestMetrics = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8421,14 +7643,18 @@ pub mod metrics { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let pipeline_id = &this.pipeline_id; req.url_mut() @@ -8459,14 +7685,14 @@ pub mod metrics { .query_pairs_mut() .append_pair("groupByNode", &group_by_node.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/metrics", self.client.endpoint(), &self.organization, @@ -8474,10 +7700,12 @@ pub mod metrics { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8534,38 +7762,15 @@ pub mod resultdetailsbybuild { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultsDetails = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8633,14 +7838,18 @@ pub mod resultdetailsbybuild { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build_id = &this.build_id; req.url_mut() @@ -8680,14 +7889,14 @@ pub mod resultdetailsbybuild { &query_run_summary_for_in_progress.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultdetailsbybuild", self.client.endpoint(), &self.organization, @@ -8695,10 +7904,12 @@ pub mod resultdetailsbybuild { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8757,38 +7968,15 @@ pub mod resultdetailsbyrelease { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultsDetails = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8857,14 +8045,18 @@ pub mod resultdetailsbyrelease { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let release_id = &this.release_id; req.url_mut() @@ -8908,14 +8100,14 @@ pub mod resultdetailsbyrelease { &query_run_summary_for_in_progress.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultdetailsbyrelease", self.client.endpoint(), &self.organization, @@ -8923,10 +8115,12 @@ pub mod resultdetailsbyrelease { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8981,40 +8175,20 @@ pub mod resultgroupsbybuild { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::FieldDetailsForTestResultsList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, - ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FieldDetailsForTestResultsList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + ) -> azure_core::Result { + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9060,14 +8234,18 @@ pub mod resultgroupsbybuild { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build_id = &this.build_id; req.url_mut() @@ -9087,14 +8265,14 @@ pub mod resultgroupsbybuild { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultgroupsbybuild", self.client.endpoint(), &self.organization, @@ -9102,10 +8280,12 @@ pub mod resultgroupsbybuild { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9162,40 +8342,20 @@ pub mod resultgroupsbyrelease { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::FieldDetailsForTestResultsList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FieldDetailsForTestResultsList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9246,14 +8406,18 @@ pub mod resultgroupsbyrelease { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let release_id = &this.release_id; req.url_mut() @@ -9278,14 +8442,14 @@ pub mod resultgroupsbyrelease { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultgroupsbyrelease", self.client.endpoint(), &self.organization, @@ -9293,10 +8457,12 @@ pub mod resultgroupsbyrelease { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9444,38 +8610,15 @@ pub mod results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultsQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9510,24 +8653,28 @@ pub mod results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/results", self.client.endpoint(), &self.organization, @@ -9535,10 +8682,12 @@ pub mod results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9563,38 +8712,15 @@ pub mod results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9649,17 +8775,21 @@ pub mod results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(include_result_details) = &this.include_result_details { req.url_mut().query_pairs_mut().append_pair( "includeResultDetails", @@ -9683,12 +8813,12 @@ pub mod results { .append_pair("$top", &top.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/results/query", self.client.endpoint(), &self.organization, @@ -9696,10 +8826,12 @@ pub mod results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9724,38 +8856,15 @@ pub mod results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9815,14 +8924,18 @@ pub mod results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(details_to_include) = &this.details_to_include { req.url_mut() @@ -9849,14 +8962,14 @@ pub mod results { .query_pairs_mut() .append_pair("$newTestsOnly", &new_tests_only.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results", self.client.endpoint(), &self.organization, @@ -9865,10 +8978,12 @@ pub mod results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9893,38 +9008,15 @@ pub mod results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9960,24 +9052,28 @@ pub mod results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results", self.client.endpoint(), &self.organization, @@ -9986,10 +9082,12 @@ pub mod results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10014,38 +9112,15 @@ pub mod results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10081,24 +9156,28 @@ pub mod results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results", self.client.endpoint(), &self.organization, @@ -10107,10 +9186,12 @@ pub mod results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10135,37 +9216,15 @@ pub mod results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResult = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10206,28 +9265,32 @@ pub mod results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(details_to_include) = &this.details_to_include { req.url_mut() .query_pairs_mut() .append_pair("detailsToInclude", details_to_include); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}", self.client.endpoint(), &self.organization, @@ -10237,10 +9300,12 @@ pub mod results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10291,38 +9356,15 @@ pub mod history { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultHistory = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10357,24 +9399,28 @@ pub mod history { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/results/history", self.client.endpoint(), &self.organization, @@ -10382,10 +9428,12 @@ pub mod history { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10462,38 +9510,18 @@ pub mod result_meta_data { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestResultMetaDataList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultMetaDataList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10534,29 +9562,33 @@ pub mod result_meta_data { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(details_to_include) = &this.details_to_include { req.url_mut() .query_pairs_mut() .append_pair("detailsToInclude", details_to_include); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/results/resultmetadata", self.client.endpoint(), &self.organization, @@ -10564,10 +9596,12 @@ pub mod result_meta_data { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10593,38 +9627,15 @@ pub mod result_meta_data { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultMetaData = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10660,24 +9671,28 @@ pub mod result_meta_data { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/results/resultmetadata/{}", self.client.endpoint(), &self.organization, @@ -10686,10 +9701,12 @@ pub mod result_meta_data { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10743,38 +9760,15 @@ pub mod test_history { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestHistoryQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10809,24 +9803,28 @@ pub mod test_history { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/results/testhistory", self.client.endpoint(), &self.organization, @@ -10834,10 +9832,12 @@ pub mod test_history { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10892,38 +9892,18 @@ pub mod resultsbybuild { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ShallowTestCaseResultList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ShallowTestCaseResultList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10978,14 +9958,18 @@ pub mod resultsbybuild { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build_id = &this.build_id; req.url_mut() @@ -11011,14 +9995,14 @@ pub mod resultsbybuild { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultsbybuild", self.client.endpoint(), &self.organization, @@ -11026,10 +10010,12 @@ pub mod resultsbybuild { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11090,38 +10076,18 @@ pub mod resultsbypipeline { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ShallowTestCaseResultList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ShallowTestCaseResultList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11192,14 +10158,18 @@ pub mod resultsbypipeline { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let pipeline_id = &this.pipeline_id; req.url_mut() @@ -11233,14 +10203,14 @@ pub mod resultsbypipeline { if let Some(continuation_token) = &this.continuation_token { req.insert_header("continuationtoken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultsbypipeline", self.client.endpoint(), &self.organization, @@ -11248,10 +10218,12 @@ pub mod resultsbypipeline { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11308,38 +10280,18 @@ pub mod resultsbyrelease { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ShallowTestCaseResultList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ShallowTestCaseResultList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11399,14 +10351,18 @@ pub mod resultsbyrelease { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let release_id = &this.release_id; req.url_mut() @@ -11437,14 +10393,14 @@ pub mod resultsbyrelease { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultsbyrelease", self.client.endpoint(), &self.organization, @@ -11452,10 +10408,12 @@ pub mod resultsbyrelease { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11515,38 +10473,15 @@ pub mod resultsgroup_details { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultsDetails = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11619,14 +10554,18 @@ pub mod resultsgroup_details { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let pipeline_id = &this.pipeline_id; req.url_mut() @@ -11663,14 +10602,14 @@ pub mod resultsgroup_details { &query_group_summary_for_in_progress.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultsgroupdetails", self.client.endpoint(), &self.organization, @@ -11678,10 +10617,12 @@ pub mod resultsgroup_details { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11741,38 +10682,15 @@ pub mod resultsummarybybuild { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultSummary = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11874,14 +10792,18 @@ pub mod resultsummarybybuild { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let build_id = &this.build_id; req.url_mut() @@ -11945,14 +10867,14 @@ pub mod resultsummarybybuild { .query_pairs_mut() .append_pair("buildToCompare.uri", build_to_compare_uri); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultsummarybybuild", self.client.endpoint(), &self.organization, @@ -11960,10 +10882,12 @@ pub mod resultsummarybybuild { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12021,38 +10945,15 @@ pub mod resultsummarybypipeline { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultSummary = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12111,14 +11012,18 @@ pub mod resultsummarybypipeline { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let pipeline_id = &this.pipeline_id; req.url_mut() @@ -12145,14 +11050,14 @@ pub mod resultsummarybypipeline { &include_failure_details.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultsummarybypipeline", self.client.endpoint(), &self.organization, @@ -12160,10 +11065,12 @@ pub mod resultsummarybypipeline { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12244,38 +11151,15 @@ pub mod resultsummarybyrelease { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultSummary = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12410,14 +11294,18 @@ pub mod resultsummarybyrelease { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let release_id = &this.release_id; req.url_mut() @@ -12447,10 +11335,12 @@ pub mod resultsummarybyrelease { if let Some(release_to_compare_creation_date) = &this.release_to_compare_creation_date { - req.url_mut().query_pairs_mut().append_pair( - "releaseToCompare.creationDate", - &release_to_compare_creation_date.to_string(), - ); + let formatted_date_time = crate::date_time::format_date_time( + release_to_compare_creation_date, + )?; + req.url_mut() + .query_pairs_mut() + .append_pair("releaseToCompare.creationDate", &formatted_date_time); } if let Some(release_to_compare_definition_id) = &this.release_to_compare_definition_id @@ -12463,9 +11353,12 @@ pub mod resultsummarybyrelease { if let Some(release_to_compare_environment_creation_date) = &this.release_to_compare_environment_creation_date { + let formatted_date_time = crate::date_time::format_date_time( + release_to_compare_environment_creation_date, + )?; req.url_mut().query_pairs_mut().append_pair( "releaseToCompare.environmentCreationDate", - &release_to_compare_environment_creation_date.to_string(), + &formatted_date_time, ); } if let Some(release_to_compare_environment_definition_id) = @@ -12511,14 +11404,14 @@ pub mod resultsummarybyrelease { .query_pairs_mut() .append_pair("releaseToCompare.name", release_to_compare_name); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultsummarybyrelease", self.client.endpoint(), &self.organization, @@ -12526,10 +11419,12 @@ pub mod resultsummarybyrelease { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12554,38 +11449,15 @@ pub mod resultsummarybyrelease { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultSummaryList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12620,24 +11492,28 @@ pub mod resultsummarybyrelease { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultsummarybyrelease", self.client.endpoint(), &self.organization, @@ -12645,10 +11521,12 @@ pub mod resultsummarybyrelease { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12700,38 +11578,18 @@ pub mod resultsummarybyrequirement { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestSummaryForWorkItemList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSummaryForWorkItemList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12771,29 +11629,33 @@ pub mod resultsummarybyrequirement { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(work_item_ids) = &this.work_item_ids { req.url_mut() .query_pairs_mut() .append_pair("workItemIds", work_item_ids); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resultsummarybyrequirement", self.client.endpoint(), &self.organization, @@ -12801,10 +11663,12 @@ pub mod resultsummarybyrequirement { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12856,40 +11720,20 @@ pub mod result_trend_by_build { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::AggregatedDataForResultTrendList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AggregatedDataForResultTrendList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12924,24 +11768,28 @@ pub mod result_trend_by_build { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resulttrendbybuild", self.client.endpoint(), &self.organization, @@ -12949,10 +11797,12 @@ pub mod result_trend_by_build { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13004,40 +11854,20 @@ pub mod result_trend_by_release { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::AggregatedDataForResultTrendList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AggregatedDataForResultTrendList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13072,24 +11902,28 @@ pub mod result_trend_by_release { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/resulttrendbyrelease", self.client.endpoint(), &self.organization, @@ -13097,10 +11931,12 @@ pub mod result_trend_by_release { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13155,38 +11991,18 @@ pub mod message_logs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestMessageLogDetailsList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestMessageLogDetailsList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13221,23 +12037,27 @@ pub mod message_logs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/messagelogs", self.client.endpoint(), &self.organization, @@ -13246,10 +12066,12 @@ pub mod message_logs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13303,38 +12125,15 @@ pub mod result_document { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultDocument = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13370,24 +12169,28 @@ pub mod result_document { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/resultdocument", self.client.endpoint(), &self.organization, @@ -13396,10 +12199,12 @@ pub mod result_document { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13452,38 +12257,15 @@ pub mod bugs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemReferenceList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13519,23 +12301,27 @@ pub mod bugs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/bugs", self.client.endpoint(), &self.organization, @@ -13545,10 +12331,12 @@ pub mod bugs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13610,38 +12398,15 @@ pub mod similar_test_results { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13690,14 +12455,18 @@ pub mod similar_test_results { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_sub_result_id = &this.test_sub_result_id; req.url_mut() @@ -13711,14 +12480,14 @@ pub mod similar_test_results { if let Some(continuation_token) = &this.continuation_token { req.insert_header("continuationtoken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/results/{}/similartestresults", self.client.endpoint(), &self.organization, @@ -13728,10 +12497,12 @@ pub mod similar_test_results { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13785,38 +12556,15 @@ pub mod runsummary { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunStatistic = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13851,23 +12599,27 @@ pub mod runsummary { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/runsummary", self.client.endpoint(), &self.organization, @@ -13876,10 +12628,12 @@ pub mod runsummary { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13933,38 +12687,15 @@ pub mod statistics { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunStatistic = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13999,23 +12730,27 @@ pub mod statistics { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/runs/{}/statistics", self.client.endpoint(), &self.organization, @@ -14024,10 +12759,12 @@ pub mod statistics { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14097,38 +12834,15 @@ pub mod settings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultsSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14167,28 +12881,32 @@ pub mod settings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(settings_type) = &this.settings_type { req.url_mut() .query_pairs_mut() .append_pair("settingsType", settings_type); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/settings", self.client.endpoint(), &self.organization, @@ -14196,10 +12914,12 @@ pub mod settings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14224,38 +12944,15 @@ pub mod settings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultsSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14290,24 +12987,28 @@ pub mod settings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/settings", self.client.endpoint(), &self.organization, @@ -14315,10 +13016,12 @@ pub mod settings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14405,38 +13108,18 @@ pub mod testfailuretype { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TestResultFailureTypeList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultFailureTypeList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14470,23 +13153,27 @@ pub mod testfailuretype { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/testfailuretype", self.client.endpoint(), &self.organization, @@ -14494,10 +13181,12 @@ pub mod testfailuretype { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14523,38 +13212,15 @@ pub mod testfailuretype { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultFailureType = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14589,24 +13255,28 @@ pub mod testfailuretype { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/testfailuretype", self.client.endpoint(), &self.organization, @@ -14614,10 +13284,12 @@ pub mod testfailuretype { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14642,23 +13314,10 @@ pub mod testfailuretype { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14693,23 +13352,27 @@ pub mod testfailuretype { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/testfailuretype/{}", self.client.endpoint(), &self.organization, @@ -14718,10 +13381,12 @@ pub mod testfailuretype { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14807,37 +13472,15 @@ pub mod testsettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSettings = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14872,27 +13515,31 @@ pub mod testsettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_settings_id = &this.test_settings_id; req.url_mut() .query_pairs_mut() .append_pair("testSettingsId", &test_settings_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/testsettings", self.client.endpoint(), &self.organization, @@ -14900,10 +13547,12 @@ pub mod testsettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -14928,37 +13577,13 @@ pub mod testsettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: i32 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -14993,24 +13618,28 @@ pub mod testsettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/testsettings", self.client.endpoint(), &self.organization, @@ -15018,10 +13647,12 @@ pub mod testsettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -15046,23 +13677,10 @@ pub mod testsettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -15097,27 +13715,31 @@ pub mod testsettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let test_settings_id = &this.test_settings_id; req.url_mut() .query_pairs_mut() .append_pair("testSettingsId", &test_settings_id.to_string()); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/testresults/testsettings", self.client.endpoint(), &self.organization, @@ -15125,10 +13747,12 @@ pub mod testsettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/test_results/models.rs b/azure_devops_rust_api/src/test_results/models.rs index aee672d9..f1478ca3 100644 --- a/azure_devops_rust_api/src/test_results/models.rs +++ b/azure_devops_rust_api/src/test_results/models.rs @@ -46,7 +46,7 @@ pub struct AggregatedDataForResultTrendList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -467,7 +467,7 @@ pub struct BuildCoverage { #[doc = "List of Modules"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub modules: Vec, @@ -486,7 +486,7 @@ pub struct BuildCoverageList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -563,7 +563,7 @@ pub struct CodeCoverageData { #[serde( rename = "coverageStats", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub coverage_stats: Vec, @@ -614,7 +614,7 @@ pub struct CodeCoverageSummary { #[serde( rename = "coverageData", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub coverage_data: Vec, @@ -820,7 +820,7 @@ pub struct FieldDetailsForTestResults { #[serde( rename = "groupsForField", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub groups_for_field: Vec, @@ -836,7 +836,7 @@ pub struct FieldDetailsForTestResultsList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -914,7 +914,7 @@ pub struct FlakyDetectionPipelines { #[serde( rename = "allowedPipelines", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub allowed_pipelines: Vec, @@ -1086,7 +1086,7 @@ pub struct ModuleCoverage { #[serde( rename = "blockData", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub block_data: Vec, @@ -1095,7 +1095,7 @@ pub struct ModuleCoverage { pub file_url: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub functions: Vec, @@ -1219,7 +1219,7 @@ pub struct PipelineTestMetrics { #[serde( rename = "summaryAtChild", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub summary_at_child: Vec, @@ -1402,7 +1402,7 @@ pub struct ResultsFilter { #[serde( rename = "testCaseReferenceIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_case_reference_ids: Vec, @@ -1415,7 +1415,7 @@ pub struct ResultsFilter { #[serde( rename = "testPointIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_point_ids: Vec, @@ -1529,7 +1529,7 @@ pub struct RunCreateModel { #[serde( rename = "configurationIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub configuration_ids: Vec, @@ -1540,7 +1540,7 @@ pub struct RunCreateModel { #[serde( rename = "customTestFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub custom_test_fields: Vec, @@ -1600,7 +1600,7 @@ pub struct RunCreateModel { #[serde( rename = "pointIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub point_ids: Vec, @@ -1629,7 +1629,7 @@ pub struct RunCreateModel { #[serde( rename = "runSummary", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub run_summary: Vec, @@ -1656,7 +1656,7 @@ pub struct RunCreateModel { #[doc = "Tags to attach with the test run, maximum of 5 tags can be added to run."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -1943,7 +1943,7 @@ pub struct RunUpdateModel { #[serde( rename = "logEntries", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub log_entries: Vec, @@ -1968,7 +1968,7 @@ pub struct RunUpdateModel { #[serde( rename = "runSummary", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub run_summary: Vec, @@ -1995,7 +1995,7 @@ pub struct RunUpdateModel { #[doc = "Tags to attach with the test run."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -2098,7 +2098,7 @@ pub struct ShallowTestCaseResult { pub run_id: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -2120,7 +2120,7 @@ pub struct ShallowTestCaseResultList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2336,7 +2336,7 @@ pub struct TestAttachmentList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2403,7 +2403,7 @@ pub struct TestCaseResult { #[serde( rename = "associatedBugs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub associated_bugs: Vec, @@ -2485,7 +2485,7 @@ pub struct TestCaseResult { #[serde( rename = "customFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub custom_fields: Vec, @@ -2524,7 +2524,7 @@ pub struct TestCaseResult { #[serde( rename = "iterationDetails", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub iteration_details: Vec, @@ -2618,7 +2618,7 @@ pub struct TestCaseResult { #[serde( rename = "subResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub sub_results: Vec, @@ -2744,7 +2744,7 @@ pub struct TestCaseResultList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2784,7 +2784,7 @@ pub struct TestFailureDetails { #[serde( rename = "testResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_results: Vec, @@ -2894,7 +2894,7 @@ pub struct TestHistoryQuery { #[serde( rename = "resultsForGroup", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results_for_group: Vec, @@ -2932,14 +2932,14 @@ pub struct TestIterationDetailsModel { #[serde( rename = "actionResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub action_results: Vec, #[doc = "Reference to attachments in test iteration result."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub attachments: Vec, @@ -2977,7 +2977,7 @@ pub struct TestIterationDetailsModel { #[doc = "Test parameters in an iteration."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub parameters: Vec, @@ -3034,7 +3034,7 @@ pub struct TestLogList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3158,7 +3158,7 @@ pub struct TestLogStoreAttachmentList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3284,7 +3284,7 @@ pub struct TestMessageLogDetailsList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3377,7 +3377,7 @@ pub struct TestResultFailureTypeList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3436,7 +3436,7 @@ pub struct TestResultHistory { #[serde( rename = "resultsForGroup", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results_for_group: Vec, @@ -3487,7 +3487,7 @@ pub struct TestResultHistoryForGroup { #[doc = "List of results for GroupByValue"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -3518,7 +3518,7 @@ pub struct TestResultMetaData { #[serde( rename = "flakyIdentifiers", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub flaky_identifiers: Vec, @@ -3554,7 +3554,7 @@ pub struct TestResultMetaDataList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3571,7 +3571,7 @@ pub struct TestResultMetaDataUpdateInput { #[serde( rename = "flakyIdentifiers", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub flaky_identifiers: Vec, @@ -3732,7 +3732,7 @@ pub struct TestResultSummaryList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3747,7 +3747,7 @@ pub struct TestResultTrendFilter { #[serde( rename = "branchNames", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub branch_names: Vec, @@ -3760,14 +3760,14 @@ pub struct TestResultTrendFilter { #[serde( rename = "definitionIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub definition_ids: Vec, #[serde( rename = "envDefinitionIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub env_definition_ids: Vec, @@ -3787,7 +3787,7 @@ pub struct TestResultTrendFilter { #[serde( rename = "testRunTitles", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub test_run_titles: Vec, @@ -3849,7 +3849,7 @@ pub struct TestResultsDetails { #[serde( rename = "resultsForGroup", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results_for_group: Vec, @@ -3869,7 +3869,7 @@ pub struct TestResultsDetailsForGroup { pub group_by_value: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -3881,7 +3881,7 @@ pub struct TestResultsDetailsForGroup { pub results_count_by_outcome: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -3895,13 +3895,13 @@ impl TestResultsDetailsForGroup { pub struct TestResultsQuery { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub fields: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -3996,7 +3996,7 @@ pub struct TestRun { #[serde( rename = "customFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub custom_fields: Vec, @@ -4145,7 +4145,7 @@ pub struct TestRun { #[serde( rename = "runStatistics", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub run_statistics: Vec, @@ -4166,7 +4166,7 @@ pub struct TestRun { #[doc = "Tags attached with this test run."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -4254,7 +4254,7 @@ pub struct TestRunCoverage { #[doc = "List of Modules Coverage"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub modules: Vec, @@ -4276,7 +4276,7 @@ pub struct TestRunCoverageList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4292,7 +4292,7 @@ pub struct TestRunList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4311,7 +4311,7 @@ pub struct TestRunStatistic { #[serde( rename = "runStatistics", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub run_statistics: Vec, @@ -4395,7 +4395,7 @@ pub struct TestSubResult { #[serde( rename = "customFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub custom_fields: Vec, @@ -4470,7 +4470,7 @@ pub struct TestSubResult { #[serde( rename = "subResults", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub sub_results: Vec, @@ -4526,7 +4526,7 @@ pub struct TestSummaryForWorkItemList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4554,7 +4554,7 @@ pub struct TestTagList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4585,7 +4585,7 @@ impl TestTagSummary { pub struct TestTagsUpdateModel { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tags: Vec, @@ -4602,7 +4602,7 @@ pub struct TestToWorkItemLinks { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec, @@ -4667,7 +4667,7 @@ pub struct WorkItemReferenceList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -4687,7 +4687,7 @@ pub struct WorkItemToTestLinks { pub executed_in: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tests: Vec, diff --git a/azure_devops_rust_api/src/tfvc/mod.rs b/azure_devops_rust_api/src/tfvc/mod.rs index 335d4468..f711902c 100644 --- a/azure_devops_rust_api/src/tfvc/mod.rs +++ b/azure_devops_rust_api/src/tfvc/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -237,38 +238,15 @@ pub mod shelvesets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcShelvesetRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -367,14 +345,18 @@ pub mod shelvesets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(request_data_include_details) = &this.request_data_include_details @@ -434,24 +416,26 @@ pub mod shelvesets { .query_pairs_mut() .append_pair("$skip", &skip.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tfvc/shelvesets?", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -476,37 +460,15 @@ pub mod shelvesets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcShelveset = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -594,14 +556,18 @@ pub mod shelvesets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let shelveset_id = &this.shelveset_id; req.url_mut() @@ -655,24 +621,26 @@ pub mod shelvesets { .query_pairs_mut() .append_pair("requestData.owner", request_data_owner); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tfvc/shelvesets", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -697,37 +665,15 @@ pub mod shelvesets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcChangeList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -773,14 +719,18 @@ pub mod shelvesets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let shelveset_id = &this.shelveset_id; req.url_mut() @@ -796,24 +746,26 @@ pub mod shelvesets { .query_pairs_mut() .append_pair("$skip", &skip.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tfvc/shelvesets/changes", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -838,38 +790,18 @@ pub mod shelvesets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::AssociatedWorkItemList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AssociatedWorkItemList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -903,37 +835,43 @@ pub mod shelvesets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let shelveset_id = &this.shelveset_id; req.url_mut() .query_pairs_mut() .append_pair("shelvesetId", shelveset_id); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tfvc/shelvesets/workitems", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1031,37 +969,15 @@ pub mod branches { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcBranch = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1108,14 +1024,18 @@ pub mod branches { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let path = &this.path; req.url_mut().query_pairs_mut().append_pair("path", path); @@ -1129,14 +1049,14 @@ pub mod branches { .query_pairs_mut() .append_pair("includeChildren", &include_children.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/tfvc/branches?path={}", self.client.endpoint(), &self.organization, @@ -1145,10 +1065,12 @@ pub mod branches { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1173,37 +1095,15 @@ pub mod branches { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcBranchList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1261,14 +1161,18 @@ pub mod branches { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_parent) = &this.include_parent { req.url_mut() @@ -1290,14 +1194,14 @@ pub mod branches { .query_pairs_mut() .append_pair("includeLinks", &include_links.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/tfvc/branches?", self.client.endpoint(), &self.organization, @@ -1305,10 +1209,12 @@ pub mod branches { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1333,38 +1239,15 @@ pub mod branches { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcBranchRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1411,14 +1294,18 @@ pub mod branches { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let scope_path = &this.scope_path; req.url_mut() @@ -1434,14 +1321,14 @@ pub mod branches { .query_pairs_mut() .append_pair("includeLinks", &include_links.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/tfvc/branches", self.client.endpoint(), &self.organization, @@ -1449,10 +1336,12 @@ pub mod branches { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1554,37 +1443,15 @@ pub mod items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1677,14 +1544,18 @@ pub mod items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let path = &this.path; req.url_mut().query_pairs_mut().append_pair("path", path); @@ -1735,14 +1606,14 @@ pub mod items { .query_pairs_mut() .append_pair("includeContent", &include_content.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/tfvc/items?path={}", self.client.endpoint(), &self.organization, @@ -1751,10 +1622,12 @@ pub mod items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1779,37 +1652,13 @@ pub mod items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response, azure_core::http::JsonFormat>); impl Response { pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1844,24 +1693,28 @@ pub mod items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/tfvc/itembatch", self.client.endpoint(), &self.organization, @@ -1869,10 +1722,12 @@ pub mod items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1897,37 +1752,15 @@ pub mod items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcItemList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2005,14 +1838,18 @@ pub mod items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(scope_path) = &this.scope_path { req.url_mut() @@ -2051,14 +1888,14 @@ pub mod items { version_descriptor_version_type, ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/tfvc/items", self.client.endpoint(), &self.organization, @@ -2066,10 +1903,12 @@ pub mod items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2238,37 +2077,15 @@ pub mod changesets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcChangeList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2320,14 +2137,18 @@ pub mod changesets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(skip) = &this.skip { req.url_mut() @@ -2344,14 +2165,14 @@ pub mod changesets { .query_pairs_mut() .append_pair("continuationToken", continuation_token); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tfvc/changesets/{}/changes", self.client.endpoint(), &self.organization, @@ -2359,10 +2180,12 @@ pub mod changesets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2387,38 +2210,18 @@ pub mod changesets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::AssociatedWorkItemList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AssociatedWorkItemList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2452,23 +2255,27 @@ pub mod changesets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tfvc/changesets/{}/workItems", self.client.endpoint(), &self.organization, @@ -2476,10 +2283,12 @@ pub mod changesets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2505,38 +2314,15 @@ pub mod changesets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcChangesetRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2570,34 +2356,40 @@ pub mod changesets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tfvc/changesetsbatch", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2622,38 +2414,15 @@ pub mod changesets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcChangesetRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2786,14 +2555,18 @@ pub mod changesets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(max_comment_length) = &this.max_comment_length { req.url_mut() @@ -2863,14 +2636,14 @@ pub mod changesets { &search_criteria_to_id.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/tfvc/changesets", self.client.endpoint(), &self.organization, @@ -2878,10 +2651,12 @@ pub mod changesets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2906,38 +2681,15 @@ pub mod changesets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcChangesetRef = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2972,24 +2724,28 @@ pub mod changesets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/tfvc/changesets", self.client.endpoint(), &self.organization, @@ -2997,10 +2753,12 @@ pub mod changesets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3025,37 +2783,15 @@ pub mod changesets { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcChangeset = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3213,14 +2949,18 @@ pub mod changesets { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(max_change_count) = &this.max_change_count { req.url_mut() @@ -3311,14 +3051,14 @@ pub mod changesets { &search_criteria_to_id.to_string(), ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/tfvc/changesets/{}", self.client.endpoint(), &self.organization, @@ -3327,10 +3067,12 @@ pub mod changesets { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3432,37 +3174,15 @@ pub mod labels { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcItemList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3508,14 +3228,18 @@ pub mod labels { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -3527,14 +3251,14 @@ pub mod labels { .query_pairs_mut() .append_pair("$skip", &skip.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tfvc/labels/{}/items", self.client.endpoint(), &self.organization, @@ -3542,10 +3266,12 @@ pub mod labels { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3570,38 +3296,15 @@ pub mod labels { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcLabelRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3689,14 +3392,18 @@ pub mod labels { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(request_data_include_links) = &this.request_data_include_links { req.url_mut().query_pairs_mut().append_pair( @@ -3744,14 +3451,14 @@ pub mod labels { .query_pairs_mut() .append_pair("$skip", &skip.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/tfvc/labels", self.client.endpoint(), &self.organization, @@ -3759,10 +3466,12 @@ pub mod labels { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3787,37 +3496,15 @@ pub mod labels { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcLabel = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3894,14 +3581,18 @@ pub mod labels { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(request_data_include_links) = &this.request_data_include_links { req.url_mut().query_pairs_mut().append_pair( @@ -3939,14 +3630,14 @@ pub mod labels { .query_pairs_mut() .append_pair("requestData.owner", request_data_owner); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/tfvc/labels/{}", self.client.endpoint(), &self.organization, @@ -3955,10 +3646,12 @@ pub mod labels { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/tfvc/models.rs b/azure_devops_rust_api/src/tfvc/models.rs index 9b59a7a7..b911d9c3 100644 --- a/azure_devops_rust_api/src/tfvc/models.rs +++ b/azure_devops_rust_api/src/tfvc/models.rs @@ -43,7 +43,7 @@ pub struct AssociatedWorkItemList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -215,7 +215,7 @@ pub struct GitRepository { #[serde( rename = "validRemoteUrls", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub valid_remote_urls: Vec, @@ -521,14 +521,14 @@ pub struct TfvcBranch { #[doc = "List of children for the branch."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub children: Vec, #[doc = "List of branch mappings."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mappings: Vec, @@ -539,7 +539,7 @@ pub struct TfvcBranch { #[serde( rename = "relatedBranches", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub related_branches: Vec, @@ -555,7 +555,7 @@ pub struct TfvcBranchList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -626,7 +626,7 @@ pub struct TfvcBranchRefList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -645,7 +645,7 @@ pub struct TfvcChange { #[serde( rename = "mergeSources", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub merge_sources: Vec, @@ -668,7 +668,7 @@ pub struct TfvcChangeList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -689,7 +689,7 @@ pub struct TfvcChangeset { #[doc = "List of associated changes."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub changes: Vec, @@ -697,7 +697,7 @@ pub struct TfvcChangeset { #[serde( rename = "checkinNotes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub checkin_notes: Vec, @@ -726,7 +726,7 @@ pub struct TfvcChangeset { #[serde( rename = "teamProjectIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub team_project_ids: Vec, @@ -734,7 +734,7 @@ pub struct TfvcChangeset { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec, @@ -798,7 +798,7 @@ pub struct TfvcChangesetRefList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -839,7 +839,7 @@ pub struct TfvcChangesetSearchCriteria { pub item_path: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mappings: Vec, @@ -862,7 +862,7 @@ pub struct TfvcChangesetsRequestData { #[serde( rename = "changesetIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub changeset_ids: Vec, @@ -1021,7 +1021,7 @@ pub struct TfvcItemList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1051,7 +1051,7 @@ pub struct TfvcItemRequestData { #[serde( rename = "itemDescriptors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub item_descriptors: Vec, @@ -1069,7 +1069,7 @@ pub struct TfvcLabel { #[doc = "List of items."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub items: Vec, @@ -1126,7 +1126,7 @@ pub struct TfvcLabelRefList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1249,7 +1249,7 @@ pub struct TfvcPolicyOverrideInfo { #[serde( rename = "policyFailures", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub policy_failures: Vec, @@ -1279,14 +1279,14 @@ pub struct TfvcShelveset { #[doc = "List of changes."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub changes: Vec, #[doc = "List of checkin notes."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub notes: Vec, @@ -1301,7 +1301,7 @@ pub struct TfvcShelveset { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec, @@ -1358,7 +1358,7 @@ pub struct TfvcShelvesetRefList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/token_admin/mod.rs b/azure_devops_rust_api/src/token_admin/mod.rs index e671b5f5..d492bb44 100644 --- a/azure_devops_rust_api/src/token_admin/mod.rs +++ b/azure_devops_rust_api/src/token_admin/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://vssps.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -174,40 +175,20 @@ pub mod personal_access_tokens { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TokenAdminPagedSessionTokens, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TokenAdminPagedSessionTokens = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -259,14 +240,18 @@ pub mod personal_access_tokens { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(page_size) = &this.page_size { req.url_mut() @@ -283,14 +268,14 @@ pub mod personal_access_tokens { .query_pairs_mut() .append_pair("isPublic", &is_public.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tokenadmin/personalaccesstokens/{}", self.client.endpoint(), &self.organization, @@ -298,10 +283,12 @@ pub mod personal_access_tokens { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -353,23 +340,10 @@ pub mod revocation_rules { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -403,34 +377,40 @@ pub mod revocation_rules { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tokenadmin/revocationrules", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -485,23 +465,10 @@ pub mod revocations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -541,39 +508,45 @@ pub mod revocations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(is_public) = &this.is_public { req.url_mut() .query_pairs_mut() .append_pair("isPublic", &is_public.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tokenadmin/revocations", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/token_admin/models.rs b/azure_devops_rust_api/src/token_admin/models.rs index 1bcc390c..3a2c8b40 100644 --- a/azure_devops_rust_api/src/token_admin/models.rs +++ b/azure_devops_rust_api/src/token_admin/models.rs @@ -56,7 +56,7 @@ pub struct SessionToken { #[serde( rename = "targetAccounts", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub target_accounts: Vec, @@ -193,7 +193,7 @@ pub struct TokenAdminPagedSessionTokens { #[doc = "The list of all session tokens in the current page."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/tokens/mod.rs b/azure_devops_rust_api/src/tokens/mod.rs index 633a12e1..bb260a5d 100644 --- a/azure_devops_rust_api/src/tokens/mod.rs +++ b/azure_devops_rust_api/src/tokens/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://vssps.dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -226,37 +227,15 @@ pub mod pats { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PagedPatTokens = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -322,14 +301,18 @@ pub mod pats { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(display_filter_option) = &this.display_filter_option { req.url_mut() @@ -356,24 +339,26 @@ pub mod pats { .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tokens/pats?", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -398,37 +383,15 @@ pub mod pats { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PatTokenResult = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -462,37 +425,43 @@ pub mod pats { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let authorization_id = &this.authorization_id; req.url_mut() .query_pairs_mut() .append_pair("authorizationId", authorization_id); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tokens/pats", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -517,37 +486,15 @@ pub mod pats { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PatTokenResult = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -581,34 +528,40 @@ pub mod pats { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tokens/pats", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -633,37 +586,15 @@ pub mod pats { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PatTokenResult = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -697,34 +628,40 @@ pub mod pats { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tokens/pats", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -749,23 +686,10 @@ pub mod pats { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -799,37 +723,43 @@ pub mod pats { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let authorization_id = &this.authorization_id; req.url_mut() .query_pairs_mut() .append_pair("authorizationId", authorization_id); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/tokens/pats", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/tokens/models.rs b/azure_devops_rust_api/src/tokens/models.rs index 0ae2a89c..f0810441 100644 --- a/azure_devops_rust_api/src/tokens/models.rs +++ b/azure_devops_rust_api/src/tokens/models.rs @@ -204,7 +204,7 @@ pub struct PagedPatTokens { #[serde( rename = "patTokens", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub pat_tokens: Vec, @@ -238,7 +238,7 @@ pub struct PatToken { #[serde( rename = "targetAccounts", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub target_accounts: Vec, @@ -489,7 +489,7 @@ pub struct SessionToken { #[serde( rename = "targetAccounts", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub target_accounts: Vec, diff --git a/azure_devops_rust_api/src/wiki/mod.rs b/azure_devops_rust_api/src/wiki/mod.rs index 478eaa2f..99045cc1 100644 --- a/azure_devops_rust_api/src/wiki/mod.rs +++ b/azure_devops_rust_api/src/wiki/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -259,37 +260,15 @@ pub mod wikis { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiV2List = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -323,23 +302,27 @@ pub mod wikis { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis", self.client.endpoint(), &self.organization, @@ -347,10 +330,12 @@ pub mod wikis { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -375,37 +360,15 @@ pub mod wikis { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiV2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -440,24 +403,28 @@ pub mod wikis { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis", self.client.endpoint(), &self.organization, @@ -465,10 +432,12 @@ pub mod wikis { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -493,37 +462,15 @@ pub mod wikis { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiV2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -558,23 +505,27 @@ pub mod wikis { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}", self.client.endpoint(), &self.organization, @@ -583,10 +534,12 @@ pub mod wikis { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -611,37 +564,15 @@ pub mod wikis { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiV2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -677,24 +608,28 @@ pub mod wikis { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}", self.client.endpoint(), &self.organization, @@ -703,10 +638,12 @@ pub mod wikis { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -731,37 +668,15 @@ pub mod wikis { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiV2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -796,23 +711,27 @@ pub mod wikis { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}", self.client.endpoint(), &self.organization, @@ -821,10 +740,12 @@ pub mod wikis { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -887,47 +808,25 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiAttachment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) + .get_str(&azure_core::http::headers::HeaderName::from_static("etag")) } } #[derive(Clone)] @@ -992,17 +891,21 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let name = &this.name; req.url_mut().query_pairs_mut().append_pair("name", name); if let Some(version_descriptor_version) = &this.version_descriptor_version { @@ -1028,12 +931,12 @@ pub mod attachments { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}/attachments", self.client.endpoint(), &self.organization, @@ -1042,10 +945,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1106,47 +1011,25 @@ pub mod page_moves { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPageMove = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) + .get_str(&azure_core::http::headers::HeaderName::from_static("etag")) } } #[derive(Clone)] @@ -1216,17 +1099,21 @@ pub mod page_moves { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(comment) = &this.comment { req.url_mut() .query_pairs_mut() @@ -1255,12 +1142,12 @@ pub mod page_moves { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}/pagemoves", self.client.endpoint(), &self.organization, @@ -1269,10 +1156,12 @@ pub mod page_moves { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1466,47 +1355,25 @@ pub mod pages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) + .get_str(&azure_core::http::headers::HeaderName::from_static("etag")) } } #[derive(Clone)] @@ -1587,14 +1454,18 @@ pub mod pages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(path) = &this.path { req.url_mut().query_pairs_mut().append_pair("path", path); @@ -1631,14 +1502,14 @@ pub mod pages { .query_pairs_mut() .append_pair("includeContent", &include_content.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}/pages", self.client.endpoint(), &self.organization, @@ -1647,10 +1518,12 @@ pub mod pages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1675,47 +1548,25 @@ pub mod pages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) + .get_str(&azure_core::http::headers::HeaderName::from_static("etag")) } } #[derive(Clone)] @@ -1787,17 +1638,21 @@ pub mod pages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let path = &this.path; req.url_mut().query_pairs_mut().append_pair("path", path); req.insert_header("if-match", &this.if_match); @@ -1829,12 +1684,12 @@ pub mod pages { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}/pages", self.client.endpoint(), &self.organization, @@ -1843,10 +1698,12 @@ pub mod pages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1871,47 +1728,25 @@ pub mod pages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) + .get_str(&azure_core::http::headers::HeaderName::from_static("etag")) } } #[derive(Clone)] @@ -1981,14 +1816,18 @@ pub mod pages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let path = &this.path; req.url_mut().query_pairs_mut().append_pair("path", path); @@ -2019,14 +1858,14 @@ pub mod pages { version_descriptor_version_type, ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}/pages", self.client.endpoint(), &self.organization, @@ -2035,10 +1874,12 @@ pub mod pages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2063,47 +1904,25 @@ pub mod pages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) + .get_str(&azure_core::http::headers::HeaderName::from_static("etag")) } } #[derive(Clone)] @@ -2151,14 +1970,18 @@ pub mod pages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(recursion_level) = &this.recursion_level { req.url_mut() @@ -2170,14 +1993,14 @@ pub mod pages { .query_pairs_mut() .append_pair("includeContent", &include_content.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", self.client.endpoint(), &self.organization, @@ -2187,10 +2010,12 @@ pub mod pages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2215,47 +2040,25 @@ pub mod pages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) + .get_str(&azure_core::http::headers::HeaderName::from_static("etag")) } } #[derive(Clone)] @@ -2299,17 +2102,21 @@ pub mod pages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.insert_header("if-match", &this.if_match); if let Some(comment) = &this.comment { req.url_mut() @@ -2317,12 +2124,12 @@ pub mod pages { .append_pair("comment", comment); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", self.client.endpoint(), &self.organization, @@ -2332,10 +2139,12 @@ pub mod pages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2360,47 +2169,25 @@ pub mod pages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } - pub fn headers(&self) -> Headers { + pub fn headers(&self) -> Headers<'_> { Headers(self.0.headers()) } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); + pub struct Headers<'a>(&'a azure_core::http::headers::Headers); impl Headers<'_> { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) + .get_str(&azure_core::http::headers::HeaderName::from_static("etag")) } } #[derive(Clone)] @@ -2442,28 +2229,32 @@ pub mod pages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(comment) = &this.comment { req.url_mut() .query_pairs_mut() .append_pair("comment", comment); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", self.client.endpoint(), &self.organization, @@ -2473,10 +2264,12 @@ pub mod pages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2534,37 +2327,15 @@ pub mod page_stats { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPageDetail = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2606,28 +2377,32 @@ pub mod page_stats { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(page_views_for_days) = &this.page_views_for_days { req.url_mut() .query_pairs_mut() .append_pair("pageViewsForDays", &page_views_for_days.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}/stats", self.client.endpoint(), &self.organization, @@ -2637,10 +2412,12 @@ pub mod page_stats { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2700,38 +2477,15 @@ pub mod pages_batch { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPageDetailList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2795,17 +2549,21 @@ pub mod pages_batch { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(version_descriptor_version) = &this.version_descriptor_version { req.url_mut().query_pairs_mut().append_pair( "versionDescriptor.version", @@ -2829,12 +2587,12 @@ pub mod pages_batch { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wiki/wikis/{}/pagesbatch", self.client.endpoint(), &self.organization, @@ -2843,10 +2601,12 @@ pub mod pages_batch { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/wiki/models.rs b/azure_devops_rust_api/src/wiki/models.rs index efa4b138..05c48ae8 100644 --- a/azure_devops_rust_api/src/wiki/models.rs +++ b/azure_devops_rust_api/src/wiki/models.rs @@ -36,7 +36,7 @@ pub struct Comment { #[doc = "The mentions of the comment."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mentions: Vec, @@ -60,7 +60,7 @@ pub struct Comment { #[doc = "The reactions on the comment."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub reactions: Vec, @@ -148,7 +148,7 @@ pub struct CommentList { #[doc = "List of comments in the current batch."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub comments: Vec, @@ -359,7 +359,7 @@ pub struct GitRepository { #[serde( rename = "validRemoteUrls", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub valid_remote_urls: Vec, @@ -705,7 +705,7 @@ pub struct WikiAttachmentResponse { #[serde( rename = "eTag", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub e_tag: Vec, @@ -828,7 +828,7 @@ pub struct WikiPage { #[serde( rename = "subPages", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub sub_pages: Vec, @@ -866,7 +866,7 @@ pub struct WikiPageDetail { #[serde( rename = "viewStats", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub view_stats: Vec, @@ -882,7 +882,7 @@ pub struct WikiPageDetailList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -931,7 +931,7 @@ pub struct WikiPageMoveResponse { #[serde( rename = "eTag", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub e_tag: Vec, @@ -951,7 +951,7 @@ pub struct WikiPageResponse { #[serde( rename = "eTag", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub e_tag: Vec, @@ -1041,7 +1041,7 @@ pub struct WikiUpdateParameters { #[doc = "Versions of the wiki."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub versions: Vec, @@ -1103,7 +1103,7 @@ pub struct WikiV2 { #[doc = "Versions of the wiki."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub versions: Vec, @@ -1119,7 +1119,7 @@ pub struct WikiV2List { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/wit/mod.rs b/azure_devops_rust_api/src/wit/mod.rs index d1be5eb0..e95d3122 100644 --- a/azure_devops_rust_api/src/wit/mod.rs +++ b/azure_devops_rust_api/src/wit/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -379,40 +380,20 @@ pub mod classification_nodes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemClassificationNodeList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemClassificationNodeList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -459,14 +440,18 @@ pub mod classification_nodes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let ids = &this.ids; req.url_mut().query_pairs_mut().append_pair("ids", ids); @@ -480,14 +465,14 @@ pub mod classification_nodes { .query_pairs_mut() .append_pair("errorPolicy", error_policy); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/classificationnodes?ids={}", self.client.endpoint(), &self.organization, @@ -496,10 +481,12 @@ pub mod classification_nodes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -525,40 +512,20 @@ pub mod classification_nodes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemClassificationNodeList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemClassificationNodeList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -598,28 +565,32 @@ pub mod classification_nodes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(depth) = &this.depth { req.url_mut() .query_pairs_mut() .append_pair("$depth", &depth.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/classificationnodes", self.client.endpoint(), &self.organization, @@ -627,10 +598,12 @@ pub mod classification_nodes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -656,38 +629,18 @@ pub mod classification_nodes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemClassificationNode, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemClassificationNode = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -729,28 +682,32 @@ pub mod classification_nodes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(depth) = &this.depth { req.url_mut() .query_pairs_mut() .append_pair("$depth", &depth.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", self.client.endpoint(), &self.organization, @@ -760,10 +717,12 @@ pub mod classification_nodes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -789,38 +748,18 @@ pub mod classification_nodes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemClassificationNode, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemClassificationNode = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -857,24 +796,28 @@ pub mod classification_nodes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", self.client.endpoint(), &self.organization, @@ -884,10 +827,12 @@ pub mod classification_nodes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -913,38 +858,18 @@ pub mod classification_nodes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemClassificationNode, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemClassificationNode = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -981,24 +906,28 @@ pub mod classification_nodes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", self.client.endpoint(), &self.organization, @@ -1008,10 +937,12 @@ pub mod classification_nodes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1037,23 +968,10 @@ pub mod classification_nodes { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1095,28 +1013,32 @@ pub mod classification_nodes { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(reclassify_id) = &this.reclassify_id { req.url_mut() .query_pairs_mut() .append_pair("$reclassifyId", &reclassify_id.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", self.client.endpoint(), &self.organization, @@ -1126,10 +1048,12 @@ pub mod classification_nodes { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1314,38 +1238,18 @@ pub mod queries { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::QueryHierarchyItemsResult, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryHierarchyItemsResult = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1397,14 +1301,18 @@ pub mod queries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let filter = &this.filter; req.url_mut() @@ -1425,14 +1333,14 @@ pub mod queries { .query_pairs_mut() .append_pair("$includeDeleted", &include_deleted.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/queries?$filter={}", self.client.endpoint(), &self.organization, @@ -1441,10 +1349,12 @@ pub mod queries { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1470,38 +1380,18 @@ pub mod queries { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::QueryHierarchyItemList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryHierarchyItemList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1553,14 +1443,18 @@ pub mod queries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() @@ -1577,14 +1471,14 @@ pub mod queries { .query_pairs_mut() .append_pair("$includeDeleted", &include_deleted.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/queries", self.client.endpoint(), &self.organization, @@ -1592,10 +1486,12 @@ pub mod queries { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1621,38 +1517,15 @@ pub mod queries { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryHierarchyItem = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1711,14 +1584,18 @@ pub mod queries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() @@ -1740,14 +1617,14 @@ pub mod queries { .query_pairs_mut() .append_pair("$useIsoDateFormat", &use_iso_date_format.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/queries/{}", self.client.endpoint(), &self.organization, @@ -1756,10 +1633,12 @@ pub mod queries { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1784,38 +1663,15 @@ pub mod queries { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryHierarchyItem = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1857,29 +1713,33 @@ pub mod queries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(validate_wiql_only) = &this.validate_wiql_only { req.url_mut() .query_pairs_mut() .append_pair("validateWiqlOnly", &validate_wiql_only.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/queries/{}", self.client.endpoint(), &self.organization, @@ -1888,10 +1748,12 @@ pub mod queries { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1916,38 +1778,15 @@ pub mod queries { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryHierarchyItem = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1989,17 +1828,21 @@ pub mod queries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(undelete_descendants) = &this.undelete_descendants { req.url_mut().query_pairs_mut().append_pair( "$undeleteDescendants", @@ -2007,12 +1850,12 @@ pub mod queries { ); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/queries/{}", self.client.endpoint(), &self.organization, @@ -2021,10 +1864,12 @@ pub mod queries { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2049,23 +1894,10 @@ pub mod queries { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2100,23 +1932,27 @@ pub mod queries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/queries/{}", self.client.endpoint(), &self.organization, @@ -2125,10 +1961,12 @@ pub mod queries { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2156,38 +1994,18 @@ pub mod queries { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::QueryHierarchyItemList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryHierarchyItemList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2222,24 +2040,28 @@ pub mod queries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/queriesbatch", self.client.endpoint(), &self.organization, @@ -2247,10 +2069,12 @@ pub mod queries { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2381,40 +2205,20 @@ pub mod recyclebin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemDeleteReferenceList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemDeleteReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2449,25 +2253,29 @@ pub mod recyclebin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let ids = &this.ids; req.url_mut().query_pairs_mut().append_pair("ids", ids); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/recyclebin?ids={}", self.client.endpoint(), &self.organization, @@ -2476,10 +2284,12 @@ pub mod recyclebin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2505,40 +2315,20 @@ pub mod recyclebin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemDeleteShallowReferenceList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemDeleteShallowReferenceList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2572,23 +2362,27 @@ pub mod recyclebin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/recyclebin", self.client.endpoint(), &self.organization, @@ -2596,10 +2390,12 @@ pub mod recyclebin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2625,37 +2421,15 @@ pub mod recyclebin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemDelete = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2690,23 +2464,27 @@ pub mod recyclebin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/recyclebin/{}", self.client.endpoint(), &self.organization, @@ -2715,10 +2493,12 @@ pub mod recyclebin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2743,37 +2523,15 @@ pub mod recyclebin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemDelete = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2809,24 +2567,28 @@ pub mod recyclebin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/recyclebin/{}", self.client.endpoint(), &self.organization, @@ -2835,10 +2597,12 @@ pub mod recyclebin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2863,23 +2627,10 @@ pub mod recyclebin { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2914,23 +2665,27 @@ pub mod recyclebin { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/recyclebin/{}", self.client.endpoint(), &self.organization, @@ -2939,10 +2694,12 @@ pub mod recyclebin { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3171,37 +2928,15 @@ pub mod comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3238,28 +2973,32 @@ pub mod comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let format = &this.format; req.url_mut() .query_pairs_mut() .append_pair("format", format); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments?format={}", self.client.endpoint(), &self.organization, @@ -3269,10 +3008,12 @@ pub mod comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3297,37 +3038,15 @@ pub mod comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3392,14 +3111,18 @@ pub mod comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -3424,14 +3147,14 @@ pub mod comments { if let Some(order) = &this.order { req.url_mut().query_pairs_mut().append_pair("order", order); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments?", self.client.endpoint(), &self.organization, @@ -3440,10 +3163,12 @@ pub mod comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3468,37 +3193,15 @@ pub mod comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3536,28 +3239,32 @@ pub mod comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; let format = &this.format; req.url_mut() .query_pairs_mut() .append_pair("format", format); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments/{}?format={}", self.client.endpoint(), &self.organization, @@ -3568,10 +3275,12 @@ pub mod comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3596,37 +3305,15 @@ pub mod comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3674,14 +3361,18 @@ pub mod comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let ids = &this.ids; req.url_mut().query_pairs_mut().append_pair("ids", ids); @@ -3695,14 +3386,14 @@ pub mod comments { .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments", self.client.endpoint(), &self.organization, @@ -3711,10 +3402,12 @@ pub mod comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3739,37 +3432,15 @@ pub mod comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3805,24 +3476,28 @@ pub mod comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments", self.client.endpoint(), &self.organization, @@ -3831,10 +3506,12 @@ pub mod comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3859,37 +3536,15 @@ pub mod comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3937,14 +3592,18 @@ pub mod comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(include_deleted) = &this.include_deleted { req.url_mut() @@ -3956,14 +3615,14 @@ pub mod comments { .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", self.client.endpoint(), &self.organization, @@ -3973,10 +3632,12 @@ pub mod comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4001,37 +3662,15 @@ pub mod comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4068,24 +3707,28 @@ pub mod comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", self.client.endpoint(), &self.organization, @@ -4095,10 +3738,12 @@ pub mod comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4123,23 +3768,10 @@ pub mod comments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4175,23 +3807,27 @@ pub mod comments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", self.client.endpoint(), &self.organization, @@ -4201,10 +3837,12 @@ pub mod comments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4252,38 +3890,15 @@ pub mod artifact_link_types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkArtifactLinkList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4316,33 +3931,39 @@ pub mod artifact_link_types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/wit/artifactlinktypes", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4405,38 +4026,15 @@ pub mod work_item_icons { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemIconList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4469,33 +4067,39 @@ pub mod work_item_icons { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/wit/workitemicons", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4520,37 +4124,15 @@ pub mod work_item_icons { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemIcon = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4596,14 +4178,18 @@ pub mod work_item_icons { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(color) = &this.color { req.url_mut().query_pairs_mut().append_pair("color", color); @@ -4613,14 +4199,14 @@ pub mod work_item_icons { .query_pairs_mut() .append_pair("v", &v.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/wit/workitemicons/{}", self.client.endpoint(), &self.organization, @@ -4628,10 +4214,12 @@ pub mod work_item_icons { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4692,38 +4280,18 @@ pub mod work_item_relation_types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemRelationTypeList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemRelationTypeList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4756,33 +4324,39 @@ pub mod work_item_relation_types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/wit/workitemrelationtypes", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4808,38 +4382,15 @@ pub mod work_item_relation_types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemRelationType = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4873,23 +4424,27 @@ pub mod work_item_relation_types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/wit/workitemrelationtypes/{}", self.client.endpoint(), &self.organization, @@ -4897,10 +4452,12 @@ pub mod work_item_relation_types { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4952,40 +4509,20 @@ pub mod work_item_transitions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemNextStateOnTransitionList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemNextStateOnTransitionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5025,14 +4562,18 @@ pub mod work_item_transitions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let ids = &this.ids; req.url_mut().query_pairs_mut().append_pair("ids", ids); @@ -5041,24 +4582,26 @@ pub mod work_item_transitions { .query_pairs_mut() .append_pair("action", action); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/wit/workitemtransitions", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5104,40 +4647,20 @@ pub mod account_my_work_recent_activity { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::AccountRecentActivityWorkItemModel2List, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AccountRecentActivityWorkItemModel2List = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5170,33 +4693,39 @@ pub mod account_my_work_recent_activity { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/_apis/work/accountmyworkrecentactivity", self.client.endpoint(), &self.organization ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5253,38 +4782,18 @@ pub mod artifact_uri_query { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ArtifactUriQueryResult, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ArtifactUriQueryResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5319,24 +4828,28 @@ pub mod artifact_uri_query { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/artifacturiquery", self.client.endpoint(), &self.organization, @@ -5344,10 +4857,12 @@ pub mod artifact_uri_query { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5452,38 +4967,15 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AttachmentReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5536,17 +5028,21 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(file_name) = &this.file_name { req.url_mut() .query_pairs_mut() @@ -5563,12 +5059,12 @@ pub mod attachments { .append_pair("areaPath", area_path); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/attachments", self.client.endpoint(), &self.organization, @@ -5576,10 +5072,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5604,37 +5102,13 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5681,14 +5155,18 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(file_name) = &this.file_name { req.url_mut() @@ -5700,14 +5178,14 @@ pub mod attachments { .query_pairs_mut() .append_pair("download", &download.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/attachments/{}", self.client.endpoint(), &self.organization, @@ -5716,10 +5194,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5744,38 +5224,15 @@ pub mod attachments { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AttachmentReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5817,17 +5274,21 @@ pub mod attachments { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.insert_header("contentrangeheader", &this.content_range_header); if let Some(file_name) = &this.file_name { req.url_mut() @@ -5835,12 +5296,12 @@ pub mod attachments { .append_pair("fileName", file_name); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/attachments/{}", self.client.endpoint(), &self.organization, @@ -5849,10 +5310,12 @@ pub mod attachments { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5983,38 +5446,15 @@ pub mod fields { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemField2List = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6054,28 +5494,32 @@ pub mod fields { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/fields", self.client.endpoint(), &self.organization, @@ -6083,10 +5527,12 @@ pub mod fields { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6111,37 +5557,15 @@ pub mod fields { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemField2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6176,24 +5600,28 @@ pub mod fields { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/fields", self.client.endpoint(), &self.organization, @@ -6201,10 +5629,12 @@ pub mod fields { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6229,37 +5659,15 @@ pub mod fields { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemField2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6294,23 +5702,27 @@ pub mod fields { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/fields/{}", self.client.endpoint(), &self.organization, @@ -6319,10 +5731,12 @@ pub mod fields { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6347,37 +5761,15 @@ pub mod fields { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemField2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6413,24 +5805,28 @@ pub mod fields { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/fields/{}", self.client.endpoint(), &self.organization, @@ -6439,10 +5835,12 @@ pub mod fields { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6467,23 +5865,10 @@ pub mod fields { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6518,23 +5903,27 @@ pub mod fields { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/fields/{}", self.client.endpoint(), &self.organization, @@ -6543,10 +5932,12 @@ pub mod fields { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6602,40 +5993,20 @@ pub mod project_process_migration { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ProcessMigrationResultModel, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessMigrationResultModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6670,24 +6041,28 @@ pub mod project_process_migration { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/projectprocessmigration", self.client.endpoint(), &self.organization, @@ -6695,10 +6070,12 @@ pub mod project_process_migration { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6754,40 +6131,20 @@ pub mod reporting_work_item_links { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ReportingWorkItemLinksBatch, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReportingWorkItemLinksBatch = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6848,14 +6205,18 @@ pub mod reporting_work_item_links { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(link_types) = &this.link_types { req.url_mut() @@ -6871,18 +6232,20 @@ pub mod reporting_work_item_links { .append_pair("continuationToken", continuation_token); } if let Some(start_date_time) = &this.start_date_time { + let formatted_date_time = + crate::date_time::format_date_time(start_date_time)?; req.url_mut() .query_pairs_mut() - .append_pair("startDateTime", &start_date_time.to_string()); + .append_pair("startDateTime", &formatted_date_time); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/reporting/workitemlinks", self.client.endpoint(), &self.organization, @@ -6890,10 +6253,12 @@ pub mod reporting_work_item_links { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6978,40 +6343,20 @@ pub mod reporting_work_item_revisions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ReportingWorkItemRevisionsBatch, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReportingWorkItemRevisionsBatch = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7117,14 +6462,18 @@ pub mod reporting_work_item_revisions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(fields) = &this.fields { req.url_mut() @@ -7140,9 +6489,11 @@ pub mod reporting_work_item_revisions { .append_pair("continuationToken", continuation_token); } if let Some(start_date_time) = &this.start_date_time { + let formatted_date_time = + crate::date_time::format_date_time(start_date_time)?; req.url_mut() .query_pairs_mut() - .append_pair("startDateTime", &start_date_time.to_string()); + .append_pair("startDateTime", &formatted_date_time); } if let Some(include_identity_ref) = &this.include_identity_ref { req.url_mut().query_pairs_mut().append_pair( @@ -7183,14 +6534,14 @@ pub mod reporting_work_item_revisions { .query_pairs_mut() .append_pair("$maxPageSize", &max_page_size.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/reporting/workitemrevisions", self.client.endpoint(), &self.organization, @@ -7198,10 +6549,12 @@ pub mod reporting_work_item_revisions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7227,40 +6580,20 @@ pub mod reporting_work_item_revisions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ReportingWorkItemRevisionsBatch, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReportingWorkItemRevisionsBatch = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7315,26 +6648,32 @@ pub mod reporting_work_item_revisions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(continuation_token) = &this.continuation_token { req.url_mut() .query_pairs_mut() .append_pair("continuationToken", continuation_token); } if let Some(start_date_time) = &this.start_date_time { + let formatted_date_time = + crate::date_time::format_date_time(start_date_time)?; req.url_mut() .query_pairs_mut() - .append_pair("startDateTime", &start_date_time.to_string()); + .append_pair("startDateTime", &formatted_date_time); } if let Some(expand) = &this.expand { req.url_mut() @@ -7342,12 +6681,12 @@ pub mod reporting_work_item_revisions { .append_pair("$expand", expand); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/reporting/workitemrevisions", self.client.endpoint(), &self.organization, @@ -7355,10 +6694,12 @@ pub mod reporting_work_item_revisions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7410,40 +6751,20 @@ pub mod work_item_revisions_discussions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::ReportingWorkItemRevisionsBatch, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReportingWorkItemRevisionsBatch = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7487,14 +6808,18 @@ pub mod work_item_revisions_discussions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(continuation_token) = &this.continuation_token { req.url_mut() @@ -7506,14 +6831,14 @@ pub mod work_item_revisions_discussions { .query_pairs_mut() .append_pair("$maxPageSize", &max_page_size.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/reporting/workItemRevisions/discussions", self.client.endpoint(), &self.organization, @@ -7521,10 +6846,12 @@ pub mod work_item_revisions_discussions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7578,23 +6905,10 @@ pub mod send_mail { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7629,24 +6943,28 @@ pub mod send_mail { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/sendmail", self.client.endpoint(), &self.organization, @@ -7654,10 +6972,12 @@ pub mod send_mail { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7770,38 +7090,18 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemTagDefinitionList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTagDefinitionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7835,23 +7135,27 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/tags", self.client.endpoint(), &self.organization, @@ -7859,10 +7163,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7888,38 +7194,15 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTagDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7954,23 +7237,27 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/tags/{}", self.client.endpoint(), &self.organization, @@ -7979,10 +7266,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8007,38 +7296,15 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTagDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8074,24 +7340,28 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/tags/{}", self.client.endpoint(), &self.organization, @@ -8100,10 +7370,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8128,23 +7400,10 @@ pub mod tags { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8179,23 +7438,27 @@ pub mod tags { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/tags/{}", self.client.endpoint(), &self.organization, @@ -8204,10 +7467,12 @@ pub mod tags { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8264,40 +7529,20 @@ pub mod temp_queries { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TemporaryQueryResponseModel, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TemporaryQueryResponseModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8332,24 +7577,28 @@ pub mod temp_queries { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/tempqueries", self.client.endpoint(), &self.organization, @@ -8357,10 +7606,12 @@ pub mod temp_queries { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8571,37 +7822,15 @@ pub mod work_items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8660,14 +7889,18 @@ pub mod work_items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let ids = &this.ids; req.url_mut().query_pairs_mut().append_pair("ids", ids); @@ -8677,9 +7910,10 @@ pub mod work_items { .append_pair("fields", fields); } if let Some(as_of) = &this.as_of { + let formatted_date_time = crate::date_time::format_date_time(as_of)?; req.url_mut() .query_pairs_mut() - .append_pair("asOf", &as_of.to_string()); + .append_pair("asOf", &formatted_date_time); } if let Some(expand) = &this.expand { req.url_mut() @@ -8691,14 +7925,14 @@ pub mod work_items { .query_pairs_mut() .append_pair("errorPolicy", error_policy); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitems", self.client.endpoint(), &self.organization, @@ -8706,10 +7940,12 @@ pub mod work_items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8734,37 +7970,15 @@ pub mod work_items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8817,14 +8031,18 @@ pub mod work_items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(fields) = &this.fields { req.url_mut() @@ -8832,23 +8050,24 @@ pub mod work_items { .append_pair("fields", fields); } if let Some(as_of) = &this.as_of { + let formatted_date_time = crate::date_time::format_date_time(as_of)?; req.url_mut() .query_pairs_mut() - .append_pair("asOf", &as_of.to_string()); + .append_pair("asOf", &formatted_date_time); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitems/${}", self.client.endpoint(), &self.organization, @@ -8857,10 +8076,12 @@ pub mod work_items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8885,37 +8106,15 @@ pub mod work_items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8975,17 +8174,21 @@ pub mod work_items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(validate_only) = &this.validate_only { req.url_mut() .query_pairs_mut() @@ -9008,12 +8211,12 @@ pub mod work_items { .append_pair("$expand", expand); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitems/${}", self.client.endpoint(), &self.organization, @@ -9022,10 +8225,12 @@ pub mod work_items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9050,37 +8255,15 @@ pub mod work_items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9133,14 +8316,18 @@ pub mod work_items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(fields) = &this.fields { req.url_mut() @@ -9148,23 +8335,24 @@ pub mod work_items { .append_pair("fields", fields); } if let Some(as_of) = &this.as_of { + let formatted_date_time = crate::date_time::format_date_time(as_of)?; req.url_mut() .query_pairs_mut() - .append_pair("asOf", &as_of.to_string()); + .append_pair("asOf", &formatted_date_time); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitems/{}", self.client.endpoint(), &self.organization, @@ -9173,10 +8361,12 @@ pub mod work_items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9201,37 +8391,15 @@ pub mod work_items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9291,17 +8459,21 @@ pub mod work_items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(validate_only) = &this.validate_only { req.url_mut() .query_pairs_mut() @@ -9324,12 +8496,12 @@ pub mod work_items { .append_pair("$expand", expand); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitems/{}", self.client.endpoint(), &self.organization, @@ -9338,10 +8510,12 @@ pub mod work_items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9366,37 +8540,15 @@ pub mod work_items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemDelete = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9437,28 +8589,32 @@ pub mod work_items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(destroy) = &this.destroy { req.url_mut() .query_pairs_mut() .append_pair("destroy", &destroy.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitems/{}", self.client.endpoint(), &self.organization, @@ -9467,10 +8623,12 @@ pub mod work_items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9495,37 +8653,15 @@ pub mod work_items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9560,24 +8696,28 @@ pub mod work_items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitemsbatch", self.client.endpoint(), &self.organization, @@ -9585,10 +8725,12 @@ pub mod work_items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9613,38 +8755,15 @@ pub mod work_items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemDeleteBatch = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9679,24 +8798,28 @@ pub mod work_items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitemsdelete", self.client.endpoint(), &self.organization, @@ -9704,10 +8827,12 @@ pub mod work_items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9784,37 +8909,15 @@ pub mod revisions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -9864,14 +8967,18 @@ pub mod revisions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -9888,14 +8995,14 @@ pub mod revisions { .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/revisions", self.client.endpoint(), &self.organization, @@ -9904,10 +9011,12 @@ pub mod revisions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -9932,37 +9041,15 @@ pub mod revisions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10003,28 +9090,32 @@ pub mod revisions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/revisions/{}", self.client.endpoint(), &self.organization, @@ -10034,10 +9125,12 @@ pub mod revisions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10112,38 +9205,15 @@ pub mod updates { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemUpdateList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10188,14 +9258,18 @@ pub mod updates { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -10207,14 +9281,14 @@ pub mod updates { .query_pairs_mut() .append_pair("$skip", &skip.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/updates", self.client.endpoint(), &self.organization, @@ -10223,10 +9297,12 @@ pub mod updates { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10251,37 +9327,15 @@ pub mod updates { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemUpdate = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10317,23 +9371,27 @@ pub mod updates { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/updates/{}", self.client.endpoint(), &self.organization, @@ -10343,10 +9401,12 @@ pub mod updates { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10453,38 +9513,15 @@ pub mod comments_reactions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentReactionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10520,23 +9557,27 @@ pub mod comments_reactions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions", self.client.endpoint(), &self.organization, @@ -10546,10 +9587,12 @@ pub mod comments_reactions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10574,38 +9617,15 @@ pub mod comments_reactions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentReaction = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10642,23 +9662,27 @@ pub mod comments_reactions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}", self.client.endpoint(), &self.organization, @@ -10669,10 +9693,12 @@ pub mod comments_reactions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10697,38 +9723,15 @@ pub mod comments_reactions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentReaction = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10765,23 +9768,27 @@ pub mod comments_reactions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}", self.client.endpoint(), &self.organization, @@ -10792,10 +9799,12 @@ pub mod comments_reactions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -10857,38 +9866,15 @@ pub mod comment_reactions_engaged_users { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -10935,14 +9921,18 @@ pub mod comment_reactions_engaged_users { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(top) = &this.top { req.url_mut() @@ -10954,14 +9944,14 @@ pub mod comment_reactions_engaged_users { .query_pairs_mut() .append_pair("$skip", &skip.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}/users", self.client.endpoint(), &self.organization, @@ -10972,10 +9962,12 @@ pub mod comment_reactions_engaged_users { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11048,38 +10040,15 @@ pub mod comments_versions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentVersionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11115,23 +10084,27 @@ pub mod comments_versions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/versions", self.client.endpoint(), &self.organization, @@ -11141,10 +10114,12 @@ pub mod comments_versions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11169,37 +10144,15 @@ pub mod comments_versions { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentVersion = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11236,23 +10189,27 @@ pub mod comments_versions { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/versions/{}", self.client.endpoint(), &self.organization, @@ -11263,10 +10220,12 @@ pub mod comments_versions { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11336,38 +10295,18 @@ pub mod work_item_type_categories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemTypeCategoryList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeCategoryList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11401,23 +10340,27 @@ pub mod work_item_type_categories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitemtypecategories", self.client.endpoint(), &self.organization, @@ -11425,10 +10368,12 @@ pub mod work_item_type_categories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11454,38 +10399,15 @@ pub mod work_item_type_categories { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeCategory = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11520,23 +10442,27 @@ pub mod work_item_type_categories { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitemtypecategories/{}", self.client.endpoint(), &self.organization, @@ -11545,10 +10471,12 @@ pub mod work_item_type_categories { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11618,38 +10546,15 @@ pub mod work_item_types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11683,23 +10588,27 @@ pub mod work_item_types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitemtypes", self.client.endpoint(), &self.organization, @@ -11707,10 +10616,12 @@ pub mod work_item_types { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11735,37 +10646,15 @@ pub mod work_item_types { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemType = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11800,23 +10689,27 @@ pub mod work_item_types { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitemtypes/{}", self.client.endpoint(), &self.organization, @@ -11825,10 +10718,12 @@ pub mod work_item_types { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -11905,40 +10800,20 @@ pub mod work_item_types_field { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemTypeFieldWithReferencesList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeFieldWithReferencesList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -11979,28 +10854,32 @@ pub mod work_item_types_field { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitemtypes/{}/fields", self.client.endpoint(), &self.organization, @@ -12009,10 +10888,12 @@ pub mod work_item_types_field { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12038,40 +10919,20 @@ pub mod work_item_types_field { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemTypeFieldWithReferences, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeFieldWithReferences = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12113,28 +10974,32 @@ pub mod work_item_types_field { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(expand) = &this.expand { req.url_mut() .query_pairs_mut() .append_pair("$expand", expand); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitemtypes/{}/fields/{}", self.client.endpoint(), &self.organization, @@ -12144,10 +11009,12 @@ pub mod work_item_types_field { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12202,38 +11069,18 @@ pub mod work_item_type_states { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemStateColorList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemStateColorList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12268,23 +11115,27 @@ pub mod work_item_type_states { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/wit/workitemtypes/{}/states", self.client.endpoint(), &self.organization, @@ -12293,10 +11144,12 @@ pub mod work_item_type_states { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12443,40 +11296,20 @@ pub mod templates { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::WorkItemTemplateReferenceList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTemplateReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12517,28 +11350,32 @@ pub mod templates { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(workitemtypename) = &this.workitemtypename { req.url_mut() .query_pairs_mut() .append_pair("workitemtypename", workitemtypename); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/wit/templates", self.client.endpoint(), &self.organization, @@ -12547,10 +11384,12 @@ pub mod templates { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12576,38 +11415,15 @@ pub mod templates { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTemplate = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12643,24 +11459,28 @@ pub mod templates { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/wit/templates", self.client.endpoint(), &self.organization, @@ -12669,10 +11489,12 @@ pub mod templates { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12697,38 +11519,15 @@ pub mod templates { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTemplate = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12764,23 +11563,27 @@ pub mod templates { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/wit/templates/{}", self.client.endpoint(), &self.organization, @@ -12790,10 +11593,12 @@ pub mod templates { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12818,38 +11623,15 @@ pub mod templates { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTemplate = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12886,24 +11668,28 @@ pub mod templates { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/wit/templates/{}", self.client.endpoint(), &self.organization, @@ -12913,10 +11699,12 @@ pub mod templates { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -12941,23 +11729,10 @@ pub mod templates { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -12993,23 +11768,27 @@ pub mod templates { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/wit/templates/{}", self.client.endpoint(), &self.organization, @@ -13019,10 +11798,12 @@ pub mod templates { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13132,38 +11913,15 @@ pub mod wiql { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemQueryResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13211,17 +11969,21 @@ pub mod wiql { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; if let Some(time_precision) = &this.time_precision { req.url_mut() .query_pairs_mut() @@ -13233,12 +11995,12 @@ pub mod wiql { .append_pair("$top", &top.to_string()); } req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/wit/wiql", self.client.endpoint(), &self.organization, @@ -13247,10 +12009,12 @@ pub mod wiql { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13275,38 +12039,15 @@ pub mod wiql { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemQueryResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13354,14 +12095,18 @@ pub mod wiql { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(time_precision) = &this.time_precision { req.url_mut() @@ -13373,14 +12118,14 @@ pub mod wiql { .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/wit/wiql/{}", self.client.endpoint(), &self.organization, @@ -13390,10 +12135,12 @@ pub mod wiql { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -13418,37 +12165,13 @@ pub mod wiql { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: i32 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -13496,14 +12219,18 @@ pub mod wiql { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Head); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(time_precision) = &this.time_precision { req.url_mut() @@ -13515,14 +12242,14 @@ pub mod wiql { .query_pairs_mut() .append_pair("$top", &top.to_string()); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/wit/wiql/{}", self.client.endpoint(), &self.organization, @@ -13532,10 +12259,12 @@ pub mod wiql { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/wit/models.rs b/azure_devops_rust_api/src/wit/models.rs index b789ef7f..1cd4b907 100644 --- a/azure_devops_rust_api/src/wit/models.rs +++ b/azure_devops_rust_api/src/wit/models.rs @@ -18,7 +18,7 @@ pub struct AccountMyWorkResult { #[serde( rename = "workItemDetails", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_details: Vec, @@ -69,7 +69,7 @@ pub struct AccountRecentActivityWorkItemModel2List { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -249,7 +249,7 @@ pub struct ArtifactUriQuery { #[serde( rename = "artifactUris", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub artifact_uris: Vec, @@ -328,7 +328,7 @@ pub struct Comment { #[doc = "The mentions of the comment."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mentions: Vec, @@ -349,7 +349,7 @@ pub struct Comment { #[doc = "The reactions of the comment."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub reactions: Vec, @@ -427,7 +427,7 @@ pub struct CommentList { #[doc = "List of comments in the current batch."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub comments: Vec, @@ -558,7 +558,7 @@ pub struct CommentReactionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -667,7 +667,7 @@ pub struct CommentVersionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -683,7 +683,7 @@ pub struct EmailRecipients { #[serde( rename = "emailAddresses", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub email_addresses: Vec, @@ -691,7 +691,7 @@ pub struct EmailRecipients { #[serde( rename = "tfIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tf_ids: Vec, @@ -699,7 +699,7 @@ pub struct EmailRecipients { #[serde( rename = "unresolvedEntityIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub unresolved_entity_ids: Vec, @@ -736,7 +736,7 @@ pub struct ExternalDeployment { #[serde( rename = "relatedWorkItemIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub related_work_item_ids: Vec, @@ -810,7 +810,7 @@ pub struct FieldDependentRule { #[serde( rename = "dependentFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dependent_fields: Vec, @@ -899,7 +899,7 @@ pub struct GitHubConnectionReposBatchRequest { #[serde( rename = "gitHubRepositoryUrls", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub git_hub_repository_urls: Vec, @@ -1005,7 +1005,7 @@ pub struct IdentityRefList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1208,7 +1208,7 @@ pub struct ProjectWorkItemStateColors { #[serde( rename = "workItemTypeStateColors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_type_state_colors: Vec, @@ -1225,7 +1225,7 @@ pub struct ProvisioningResult { #[serde( rename = "provisioningImportEvents", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub provisioning_import_events: Vec, @@ -1251,7 +1251,7 @@ pub struct QueryBatchGetRequest { #[doc = "The requested query ids"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ids: Vec, @@ -1294,7 +1294,7 @@ pub struct QueryHierarchyItem { #[doc = "The child query items inside a query folder."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub children: Vec, @@ -1304,7 +1304,7 @@ pub struct QueryHierarchyItem { #[doc = "The columns of the query."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub columns: Vec, @@ -1406,7 +1406,7 @@ pub struct QueryHierarchyItem { #[serde( rename = "sortColumns", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub sort_columns: Vec, @@ -1505,7 +1505,7 @@ pub struct QueryHierarchyItemList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1526,7 +1526,7 @@ pub struct QueryHierarchyItemsResult { #[doc = "The list of items"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1574,7 +1574,7 @@ pub struct ReportingWorkItemRevisionsFilter { #[doc = "A list of fields to return in work item revisions. Omit this parameter to get all reportable fields."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub fields: Vec, @@ -1609,7 +1609,7 @@ pub struct ReportingWorkItemRevisionsFilter { #[doc = "A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub types: Vec, @@ -1623,13 +1623,13 @@ impl ReportingWorkItemRevisionsFilter { pub struct SendMailBody { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub fields: Vec, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ids: Vec, @@ -1646,7 +1646,7 @@ pub struct SendMailBody { #[serde( rename = "sortFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub sort_fields: Vec, @@ -1687,7 +1687,7 @@ pub struct StreamedBatch { #[doc = "Values such as rel, sourceId, TargetId, ChangedDate, isActive."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -1824,7 +1824,7 @@ pub struct WorkArtifactLinkList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1853,7 +1853,7 @@ pub struct WorkItem { #[doc = "Relations of the work item."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub relations: Vec, @@ -1901,14 +1901,14 @@ pub struct WorkItemBatchGetRequest { #[doc = "The requested fields"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub fields: Vec, #[doc = "The requested work item ids"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ids: Vec, @@ -1954,7 +1954,7 @@ pub struct WorkItemClassificationNode { #[doc = "List of child nodes fetched."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub children: Vec, @@ -2017,7 +2017,7 @@ pub struct WorkItemClassificationNodeList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2128,7 +2128,7 @@ pub struct WorkItemComments { #[doc = "Comments collection."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub comments: Vec, @@ -2181,7 +2181,7 @@ pub struct WorkItemDeleteBatch { #[doc = "List of results for each work item"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -2200,7 +2200,7 @@ pub struct WorkItemDeleteBatchRequest { #[doc = "The requested work item ids"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ids: Vec, @@ -2263,7 +2263,7 @@ pub struct WorkItemDeleteReferenceList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2294,7 +2294,7 @@ pub struct WorkItemDeleteShallowReferenceList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2382,7 +2382,7 @@ pub struct WorkItemField { #[serde( rename = "supportedOperations", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub supported_operations: Vec, @@ -2486,7 +2486,7 @@ pub struct WorkItemField2List { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2503,7 +2503,7 @@ pub struct WorkItemFieldAllowedValues { #[serde( rename = "allowedValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub allowed_values: Vec, @@ -2622,7 +2622,7 @@ pub struct WorkItemIconList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2656,7 +2656,7 @@ pub struct WorkItemList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2697,7 +2697,7 @@ pub struct WorkItemNextStateOnTransitionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2713,7 +2713,7 @@ pub struct WorkItemQueryClause { #[doc = "Child clauses if the current clause is a logical operator"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub clauses: Vec, @@ -2780,7 +2780,7 @@ pub struct WorkItemQueryResult { #[doc = "The columns of the query."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub columns: Vec, @@ -2798,7 +2798,7 @@ pub struct WorkItemQueryResult { #[serde( rename = "sortColumns", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub sort_columns: Vec, @@ -2806,7 +2806,7 @@ pub struct WorkItemQueryResult { #[serde( rename = "workItemRelations", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_relations: Vec, @@ -2814,7 +2814,7 @@ pub struct WorkItemQueryResult { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec, @@ -2908,7 +2908,7 @@ pub struct WorkItemRelationTypeList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2924,21 +2924,21 @@ pub struct WorkItemRelationUpdates { #[doc = "List of newly added relations."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub added: Vec, #[doc = "List of removed relations."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub removed: Vec, #[doc = "List of updated relations."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub updated: Vec, @@ -2972,7 +2972,7 @@ pub struct WorkItemStateColorList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2988,7 +2988,7 @@ pub struct WorkItemStateTransition { #[doc = "Gets a list of actions needed to transition to that state."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub actions: Vec, @@ -3028,7 +3028,7 @@ pub struct WorkItemTagDefinitionList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3094,7 +3094,7 @@ pub struct WorkItemTemplateReferenceList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3170,14 +3170,14 @@ pub struct WorkItemType { #[serde( rename = "fieldInstances", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub field_instances: Vec, #[doc = "The fields that exist on the work item type."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub fields: Vec, @@ -3204,7 +3204,7 @@ pub struct WorkItemType { #[doc = "Gets state information for the work item type."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub states: Vec, @@ -3259,7 +3259,7 @@ pub struct WorkItemTypeCategory { #[serde( rename = "workItemTypes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_types: Vec, @@ -3281,7 +3281,7 @@ pub struct WorkItemTypeCategoryList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3359,7 +3359,7 @@ pub struct WorkItemTypeFieldInstance { #[serde( rename = "allowedValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub allowed_values: Vec, @@ -3392,7 +3392,7 @@ pub struct WorkItemTypeFieldInstanceBase { #[serde( rename = "dependentFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub dependent_fields: Vec, @@ -3414,7 +3414,7 @@ pub struct WorkItemTypeFieldWithReferences { #[serde( rename = "allowedValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub allowed_values: Vec, @@ -3437,7 +3437,7 @@ pub struct WorkItemTypeFieldWithReferencesList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3453,7 +3453,7 @@ pub struct WorkItemTypeList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -3487,7 +3487,7 @@ pub struct WorkItemTypeStateColors { #[serde( rename = "stateColors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub state_colors: Vec, @@ -3619,7 +3619,7 @@ pub struct WorkItemUpdateList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, diff --git a/azure_devops_rust_api/src/work/mod.rs b/azure_devops_rust_api/src/work/mod.rs index d7bfa20c..58c78191 100644 --- a/azure_devops_rust_api/src/work/mod.rs +++ b/azure_devops_rust_api/src/work/mod.rs @@ -9,17 +9,17 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: azure_core::Url, + endpoint: azure_core::http::Url, credential: crate::Credential, scopes: Vec, - pipeline: azure_core::Pipeline, + pipeline: azure_core::http::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: crate::Credential, - endpoint: Option, + endpoint: Option, scopes: Option>, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, } azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com/"); impl ClientBuilder { @@ -30,12 +30,12 @@ impl ClientBuilder { credential, endpoint: None, scopes: None, - options: azure_core::ClientOptions::default(), + options: azure_core::http::ClientOptions::default(), } } #[doc = "Set the endpoint."] #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { + pub fn endpoint(mut self, endpoint: impl Into) -> Self { self.endpoint = Some(endpoint.into()); self } @@ -47,32 +47,32 @@ impl ClientBuilder { } #[doc = "Set the retry options."] #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); + pub fn retry(mut self, retry: impl Into) -> Self { + self.options.retry = Some(retry.into()); self } #[doc = "Set the transport options."] #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); + pub fn transport(mut self, transport: impl Into) -> Self { + self.options.transport = Some(transport.into()); self } #[doc = "Set per-call policies."] #[must_use] pub fn per_call_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_call_policies(policies); + self.options.per_call_policies = policies.into(); self } - #[doc = "Set per-retry policies."] + #[doc = "Set per-try policies."] #[must_use] - pub fn per_retry_policies( + pub fn per_try_policies( mut self, - policies: impl Into>>, + policies: impl Into>>, ) -> Self { - self.options = self.options.per_retry_policies(policies); + self.options.per_try_policies = policies.into(); self } #[doc = "Convert the builder into a `Client` instance."] @@ -85,7 +85,7 @@ impl ClientBuilder { } } impl Client { - pub(crate) fn endpoint(&self) -> &azure_core::Url { + pub(crate) fn endpoint(&self) -> &azure_core::http::Url { &self.endpoint } pub(crate) fn token_credential(&self) -> &crate::Credential { @@ -96,9 +96,9 @@ impl Client { } pub(crate) async fn send( &self, - request: &mut azure_core::Request, - ) -> azure_core::Result { - let context = azure_core::Context::default(); + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + let context = azure_core::http::Context::default(); self.pipeline.send(&context, request).await } #[doc = "Create a new `ClientBuilder`."] @@ -109,18 +109,19 @@ impl Client { #[doc = "Create a new `Client`."] #[must_use] pub fn new( - endpoint: impl Into, + endpoint: impl Into, credential: crate::Credential, scopes: Vec, - options: azure_core::ClientOptions, + options: azure_core::http::ClientOptions, ) -> Self { let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( + let pipeline = azure_core::http::Pipeline::new( option_env!("CARGO_PKG_NAME"), option_env!("CARGO_PKG_VERSION"), options, Vec::new(), Vec::new(), + None, ); Self { endpoint, @@ -237,38 +238,18 @@ pub mod boardcolumns { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::BoardSuggestedValueList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardSuggestedValueList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -302,23 +283,27 @@ pub mod boardcolumns { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/work/boardcolumns", self.client.endpoint(), &self.organization, @@ -326,10 +311,12 @@ pub mod boardcolumns { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -381,38 +368,18 @@ pub mod boardrows { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::BoardSuggestedValueList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardSuggestedValueList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -446,23 +413,27 @@ pub mod boardrows { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/work/boardrows", self.client.endpoint(), &self.organization, @@ -470,10 +441,12 @@ pub mod boardrows { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -528,38 +501,15 @@ pub mod iterationcapacities { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IterationCapacity = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -594,23 +544,27 @@ pub mod iterationcapacities { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/work/iterations/{}/iterationcapacities", self.client.endpoint(), &self.organization, @@ -619,10 +573,12 @@ pub mod iterationcapacities { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -752,37 +708,15 @@ pub mod plans { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PlanList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -816,23 +750,27 @@ pub mod plans { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/work/plans", self.client.endpoint(), &self.organization, @@ -840,10 +778,12 @@ pub mod plans { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -868,37 +808,13 @@ pub mod plans { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Plan = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -933,24 +849,28 @@ pub mod plans { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/work/plans", self.client.endpoint(), &self.organization, @@ -958,10 +878,12 @@ pub mod plans { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -986,37 +908,13 @@ pub mod plans { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Plan = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1051,23 +949,27 @@ pub mod plans { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/work/plans/{}", self.client.endpoint(), &self.organization, @@ -1076,10 +978,12 @@ pub mod plans { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1104,37 +1008,13 @@ pub mod plans { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Plan = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1170,24 +1050,28 @@ pub mod plans { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/work/plans/{}", self.client.endpoint(), &self.organization, @@ -1196,10 +1080,12 @@ pub mod plans { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1224,23 +1110,10 @@ pub mod plans { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1275,23 +1148,27 @@ pub mod plans { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/work/plans/{}", self.client.endpoint(), &self.organization, @@ -1300,10 +1177,12 @@ pub mod plans { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1363,38 +1242,15 @@ pub mod deliverytimeline { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeliveryViewData = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1447,14 +1303,18 @@ pub mod deliverytimeline { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(revision) = &this.revision { req.url_mut() @@ -1462,23 +1322,26 @@ pub mod deliverytimeline { .append_pair("revision", &revision.to_string()); } if let Some(start_date) = &this.start_date { + let formatted_date_time = + crate::date_time::format_date_time(start_date)?; req.url_mut() .query_pairs_mut() - .append_pair("startDate", &start_date.to_string()); + .append_pair("startDate", &formatted_date_time); } if let Some(end_date) = &this.end_date { + let formatted_date_time = crate::date_time::format_date_time(end_date)?; req.url_mut() .query_pairs_mut() - .append_pair("endDate", &end_date.to_string()); + .append_pair("endDate", &formatted_date_time); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/work/plans/{}/deliverytimeline", self.client.endpoint(), &self.organization, @@ -1487,10 +1350,12 @@ pub mod deliverytimeline { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1541,38 +1406,15 @@ pub mod processconfiguration { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1606,23 +1448,27 @@ pub mod processconfiguration { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/_apis/work/processconfiguration", self.client.endpoint(), &self.organization, @@ -1630,10 +1476,12 @@ pub mod processconfiguration { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1687,38 +1535,15 @@ pub mod backlogconfiguration { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BacklogConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1753,23 +1578,27 @@ pub mod backlogconfiguration { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/backlogconfiguration", self.client.endpoint(), &self.organization, @@ -1778,10 +1607,12 @@ pub mod backlogconfiguration { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -1878,40 +1709,20 @@ pub mod backlogs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::BacklogLevelConfigurationList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BacklogLevelConfigurationList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -1946,23 +1757,27 @@ pub mod backlogs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/backlogs", self.client.endpoint(), &self.organization, @@ -1971,10 +1786,12 @@ pub mod backlogs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2000,38 +1817,15 @@ pub mod backlogs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BacklogLevelWorkItems = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2067,23 +1861,27 @@ pub mod backlogs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/backlogs/{}/workItems", self.client.endpoint(), &self.organization, @@ -2093,10 +1891,12 @@ pub mod backlogs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2121,38 +1921,18 @@ pub mod backlogs { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::BacklogLevelConfiguration, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BacklogLevelConfiguration = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2188,23 +1968,27 @@ pub mod backlogs { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/backlogs/{}", self.client.endpoint(), &self.organization, @@ -2214,10 +1998,12 @@ pub mod backlogs { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2319,38 +2105,15 @@ pub mod boards { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardReferenceList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2385,23 +2148,27 @@ pub mod boards { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards", self.client.endpoint(), &self.organization, @@ -2410,10 +2177,12 @@ pub mod boards { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2438,37 +2207,15 @@ pub mod boards { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Board = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2504,23 +2251,27 @@ pub mod boards { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}", self.client.endpoint(), &self.organization, @@ -2530,10 +2281,12 @@ pub mod boards { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2558,37 +2311,15 @@ pub mod boards { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: serde_json::Value = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2625,24 +2356,28 @@ pub mod boards { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}", self.client.endpoint(), &self.organization, @@ -2652,10 +2387,12 @@ pub mod boards { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2735,38 +2472,15 @@ pub mod boardusersettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardUserSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2802,23 +2516,27 @@ pub mod boardusersettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/boardusersettings", self.client.endpoint(), &self.organization, @@ -2828,10 +2546,12 @@ pub mod boardusersettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -2856,38 +2576,15 @@ pub mod boardusersettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardUserSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -2924,24 +2621,28 @@ pub mod boardusersettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/boardusersettings", self.client.endpoint(), &self.organization, @@ -2951,10 +2652,12 @@ pub mod boardusersettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3054,38 +2757,15 @@ pub mod cardrulesettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardCardRuleSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3121,23 +2801,27 @@ pub mod cardrulesettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/cardrulesettings", self.client.endpoint(), &self.organization, @@ -3147,10 +2831,12 @@ pub mod cardrulesettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3175,38 +2861,15 @@ pub mod cardrulesettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardCardRuleSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3243,24 +2906,28 @@ pub mod cardrulesettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/cardrulesettings", self.client.endpoint(), &self.organization, @@ -3270,10 +2937,12 @@ pub mod cardrulesettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3298,23 +2967,10 @@ pub mod cardrulesettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3350,24 +3006,28 @@ pub mod cardrulesettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/taskboard/cardrulesettings", self.client.endpoint(), &self.organization, @@ -3376,10 +3036,12 @@ pub mod cardrulesettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3482,38 +3144,15 @@ pub mod cardsettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardCardSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3549,23 +3188,27 @@ pub mod cardsettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/cardsettings", self.client.endpoint(), &self.organization, @@ -3575,10 +3218,12 @@ pub mod cardsettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3603,38 +3248,15 @@ pub mod cardsettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardCardSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3671,24 +3293,28 @@ pub mod cardsettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/cardsettings", self.client.endpoint(), &self.organization, @@ -3698,10 +3324,12 @@ pub mod cardsettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3726,23 +3354,10 @@ pub mod cardsettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -3778,24 +3393,28 @@ pub mod cardsettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/taskboard/cardsettings", self.client.endpoint(), &self.organization, @@ -3804,10 +3423,12 @@ pub mod cardsettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -3930,37 +3551,13 @@ pub mod chartimages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4021,14 +3618,18 @@ pub mod chartimages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(width) = &this.width { req.url_mut() @@ -4048,14 +3649,14 @@ pub mod chartimages { if let Some(title) = &this.title { req.url_mut().query_pairs_mut().append_pair("title", title); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/chartimages/{}", self.client.endpoint(), &self.organization, @@ -4066,10 +3667,12 @@ pub mod chartimages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4094,37 +3697,13 @@ pub mod chartimages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4185,14 +3764,18 @@ pub mod chartimages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(width) = &this.width { req.url_mut() @@ -4212,14 +3795,14 @@ pub mod chartimages { if let Some(title) = &this.title { req.url_mut().query_pairs_mut().append_pair("title", title); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/iterations/{}/chartimages/{}", self.client.endpoint(), &self.organization, @@ -4230,10 +3813,12 @@ pub mod chartimages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4258,37 +3843,13 @@ pub mod chartimages { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4354,14 +3915,18 @@ pub mod chartimages { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(iterations_number) = &this.iterations_number { req.url_mut() @@ -4386,14 +3951,14 @@ pub mod chartimages { if let Some(title) = &this.title { req.url_mut().query_pairs_mut().append_pair("title", title); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/iterations/chartimages/{}", self.client.endpoint(), &self.organization, @@ -4403,10 +3968,12 @@ pub mod chartimages { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4515,38 +4082,18 @@ pub mod charts { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::BoardChartReferenceList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardChartReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4582,23 +4129,27 @@ pub mod charts { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/charts", self.client.endpoint(), &self.organization, @@ -4608,10 +4159,12 @@ pub mod charts { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4637,37 +4190,15 @@ pub mod charts { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardChart = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4704,23 +4235,27 @@ pub mod charts { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/charts/{}", self.client.endpoint(), &self.organization, @@ -4731,10 +4266,12 @@ pub mod charts { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4759,37 +4296,15 @@ pub mod charts { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardChart = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -4827,24 +4342,28 @@ pub mod charts { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/charts/{}", self.client.endpoint(), &self.organization, @@ -4855,10 +4374,12 @@ pub mod charts { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -4940,38 +4461,15 @@ pub mod columns { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardColumnList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5007,23 +4505,27 @@ pub mod columns { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/columns", self.client.endpoint(), &self.organization, @@ -5033,10 +4535,12 @@ pub mod columns { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5061,38 +4565,15 @@ pub mod columns { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardColumnList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5129,24 +4610,28 @@ pub mod columns { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/columns", self.client.endpoint(), &self.organization, @@ -5156,10 +4641,12 @@ pub mod columns { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5241,37 +4728,15 @@ pub mod rows { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardRowList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5307,23 +4772,27 @@ pub mod rows { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/rows", self.client.endpoint(), &self.organization, @@ -5333,10 +4802,12 @@ pub mod rows { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5361,37 +4832,15 @@ pub mod rows { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardRowList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5428,24 +4877,28 @@ pub mod rows { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/{}/rows", self.client.endpoint(), &self.organization, @@ -5455,10 +4908,12 @@ pub mod rows { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5517,38 +4972,15 @@ pub mod boardparents { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ParentChildWiMapList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5585,14 +5017,18 @@ pub mod boardparents { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } let child_backlog_context_category_ref_name = &this.child_backlog_context_category_ref_name; @@ -5604,14 +5040,14 @@ pub mod boardparents { req.url_mut() .query_pairs_mut() .append_pair("workitemIds", workitem_ids); - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/boards/boardparents", self.client.endpoint(), &self.organization, @@ -5620,10 +5056,12 @@ pub mod boardparents { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5703,38 +5141,15 @@ pub mod workitemsorder { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReorderResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5771,24 +5186,28 @@ pub mod workitemsorder { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/iterations/{}/workitemsorder", self.client.endpoint(), &self.organization, @@ -5798,10 +5217,12 @@ pub mod workitemsorder { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5826,38 +5247,15 @@ pub mod workitemsorder { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ReorderResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -5893,24 +5291,28 @@ pub mod workitemsorder { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/workitemsorder", self.client.endpoint(), &self.organization, @@ -5919,10 +5321,12 @@ pub mod workitemsorder { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -5993,38 +5397,15 @@ pub mod taskboard_columns { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskboardColumns = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6059,23 +5440,27 @@ pub mod taskboard_columns { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/taskboardcolumns", self.client.endpoint(), &self.organization, @@ -6084,10 +5469,12 @@ pub mod taskboard_columns { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6112,38 +5499,15 @@ pub mod taskboard_columns { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskboardColumns = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6179,24 +5543,28 @@ pub mod taskboard_columns { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/taskboardcolumns", self.client.endpoint(), &self.organization, @@ -6205,10 +5573,12 @@ pub mod taskboard_columns { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6285,40 +5655,20 @@ pub mod taskboard_work_items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TaskboardWorkItemColumnList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskboardWorkItemColumnList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6354,23 +5704,27 @@ pub mod taskboard_work_items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/taskboardworkitems/{}", self.client.endpoint(), &self.organization, @@ -6380,10 +5734,12 @@ pub mod taskboard_work_items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6409,23 +5765,10 @@ pub mod taskboard_work_items { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6463,24 +5806,28 @@ pub mod taskboard_work_items { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/taskboardworkitems/{}/{}", self.client.endpoint(), &self.organization, @@ -6491,10 +5838,12 @@ pub mod taskboard_work_items { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6573,37 +5922,15 @@ pub mod teamsettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSetting = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6638,23 +5965,27 @@ pub mod teamsettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings", self.client.endpoint(), &self.organization, @@ -6663,10 +5994,12 @@ pub mod teamsettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6691,37 +6024,15 @@ pub mod teamsettings { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSetting = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -6757,24 +6068,28 @@ pub mod teamsettings { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings", self.client.endpoint(), &self.organization, @@ -6783,10 +6098,12 @@ pub mod teamsettings { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -6929,38 +6246,18 @@ pub mod iterations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TeamSettingsIterationList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSettingsIterationList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7001,28 +6298,32 @@ pub mod iterations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } if let Some(timeframe) = &this.timeframe { req.url_mut() .query_pairs_mut() .append_pair("$timeframe", timeframe); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/iterations", self.client.endpoint(), &self.organization, @@ -7031,10 +6332,12 @@ pub mod iterations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7060,38 +6363,15 @@ pub mod iterations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSettingsIteration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7127,24 +6407,28 @@ pub mod iterations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Post); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/iterations", self.client.endpoint(), &self.organization, @@ -7153,10 +6437,12 @@ pub mod iterations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7181,38 +6467,15 @@ pub mod iterations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSettingsIteration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7248,23 +6511,27 @@ pub mod iterations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}", self.client.endpoint(), &self.organization, @@ -7274,10 +6541,12 @@ pub mod iterations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7302,23 +6571,10 @@ pub mod iterations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>); impl Response { - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7354,23 +6610,27 @@ pub mod iterations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Delete); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}", self.client.endpoint(), &self.organization, @@ -7380,10 +6640,12 @@ pub mod iterations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7411,38 +6673,15 @@ pub mod iterations { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IterationWorkItems = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7478,23 +6717,27 @@ pub mod iterations { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/workitems", self.client.endpoint(), &self.organization, @@ -7504,10 +6747,12 @@ pub mod iterations { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7642,37 +6887,15 @@ pub mod capacities { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamCapacity = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7708,23 +6931,27 @@ pub mod capacities { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities", self.client.endpoint(), &self.organization, @@ -7734,10 +6961,12 @@ pub mod capacities { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7762,40 +6991,20 @@ pub mod capacities { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TeamMemberCapacityIdentityRefList, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamMemberCapacityIdentityRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7832,24 +7041,28 @@ pub mod capacities { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Put); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities", self.client.endpoint(), &self.organization, @@ -7859,10 +7072,12 @@ pub mod capacities { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -7888,40 +7103,20 @@ pub mod capacities { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TeamMemberCapacityIdentityRef, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamMemberCapacityIdentityRef = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -7958,23 +7153,27 @@ pub mod capacities { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities/{}", self.client.endpoint(), &self.organization, @@ -7985,10 +7184,12 @@ pub mod capacities { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8014,40 +7215,20 @@ pub mod capacities { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response< + models::TeamMemberCapacityIdentityRef, + azure_core::http::JsonFormat, + >, + ); impl Response { pub async fn into_body( self, ) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamMemberCapacityIdentityRef = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + self.0.into_body().await } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8085,24 +7266,28 @@ pub mod capacities { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities/{}", self.client.endpoint(), &self.organization, @@ -8113,10 +7298,12 @@ pub mod capacities { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8199,38 +7386,15 @@ pub mod teamdaysoff { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSettingsDaysOff = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8266,23 +7430,27 @@ pub mod teamdaysoff { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/teamdaysoff", self.client.endpoint(), &self.organization, @@ -8292,10 +7460,12 @@ pub mod teamdaysoff { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8320,38 +7490,15 @@ pub mod teamdaysoff { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSettingsDaysOff = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + self.0.into_body().await } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8388,24 +7535,28 @@ pub mod teamdaysoff { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/teamdaysoff", self.client.endpoint(), &self.organization, @@ -8415,10 +7566,12 @@ pub mod teamdaysoff { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8493,38 +7646,15 @@ pub mod teamfieldvalues { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamFieldValues = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + self.0.into_body().await } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8559,23 +7689,27 @@ pub mod teamfieldvalues { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Get); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } - let req_body = azure_core::EMPTY_BODY; + let req_body = azure_core::Bytes::new(); req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/teamfieldvalues", self.client.endpoint(), &self.organization, @@ -8584,10 +7718,12 @@ pub mod teamfieldvalues { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } @@ -8612,38 +7748,15 @@ pub mod teamfieldvalues { #[cfg(target_arch = "wasm32")] use futures::future::LocalBoxFuture as BoxFuture; #[derive(Debug)] - pub struct Response(azure_core::Response); + pub struct Response( + azure_core::http::Response, + ); impl Response { pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamFieldValues = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) + self.0.into_body().await } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + pub fn into_raw_response(self) -> azure_core::http::BufResponse { + self.0.into() } } #[derive(Clone)] @@ -8679,24 +7792,28 @@ pub mod teamfieldvalues { let this = self.clone(); async move { let url = this.url()?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = + azure_core::http::Request::new(url, azure_core::http::Method::Patch); if let Some(auth_header) = this .client .token_credential() .http_authorization_header(&this.client.scopes()) .await? { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); } req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + let req_body = azure_core::json::to_json(&this.body)?; req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(http://github.com/&self) -> azure_core::Result { - let mut url = azure_core::Url::parse(&format!( + fn url(http://github.com/&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( "{}/{}/{}/{}/_apis/work/teamsettings/teamfieldvalues", self.client.endpoint(), &self.organization, @@ -8705,10 +7822,12 @@ pub mod teamfieldvalues { ))?; let has_api_version_already = url .query_pairs() - .any(|(k, _)| k == azure_core::query_param::API_VERSION); + .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION); if !has_api_version_already { - url.query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + url.query_pairs_mut().append_pair( + azure_core::http::headers::query_param::API_VERSION, + "7.1-preview", + ); } Ok(url) } diff --git a/azure_devops_rust_api/src/work/models.rs b/azure_devops_rust_api/src/work/models.rs index bdd80fd4..6f99288d 100644 --- a/azure_devops_rust_api/src/work/models.rs +++ b/azure_devops_rust_api/src/work/models.rs @@ -57,7 +57,7 @@ pub struct BacklogConfiguration { #[serde( rename = "hiddenBacklogs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub hidden_backlogs: Vec, @@ -72,7 +72,7 @@ pub struct BacklogConfiguration { #[serde( rename = "portfolioBacklogs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub portfolio_backlogs: Vec, @@ -94,7 +94,7 @@ pub struct BacklogConfiguration { #[serde( rename = "workItemTypeMappedStates", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_type_mapped_states: Vec, @@ -153,7 +153,7 @@ pub struct BacklogLevel { #[serde( rename = "workItemStates", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_states: Vec, @@ -161,7 +161,7 @@ pub struct BacklogLevel { #[serde( rename = "workItemTypes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_types: Vec, @@ -177,7 +177,7 @@ pub struct BacklogLevelConfiguration { #[serde( rename = "addPanelFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub add_panel_fields: Vec, @@ -188,7 +188,7 @@ pub struct BacklogLevelConfiguration { #[serde( rename = "columnFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub column_fields: Vec, @@ -225,7 +225,7 @@ pub struct BacklogLevelConfiguration { #[serde( rename = "workItemTypes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_types: Vec, @@ -254,7 +254,7 @@ pub struct BacklogLevelConfigurationList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -271,7 +271,7 @@ pub struct BacklogLevelWorkItems { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec, @@ -298,7 +298,7 @@ pub struct Board { pub can_edit: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub columns: Vec, @@ -310,7 +310,7 @@ pub struct Board { pub revision: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub rows: Vec, @@ -396,7 +396,7 @@ pub struct BoardChartReferenceList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -454,7 +454,7 @@ pub struct BoardColumnList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -508,7 +508,7 @@ pub struct BoardReferenceList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -538,7 +538,7 @@ pub struct BoardRowList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -564,7 +564,7 @@ pub struct BoardSuggestedValueList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -595,7 +595,7 @@ pub struct CapacityContractBase { #[doc = "Collection of capacities associated with the team member"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub activities: Vec, @@ -603,7 +603,7 @@ pub struct CapacityContractBase { #[serde( rename = "daysOff", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub days_off: Vec, @@ -618,14 +618,14 @@ impl CapacityContractBase { pub struct CapacityPatch { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub activities: Vec, #[serde( rename = "daysOff", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub days_off: Vec, @@ -642,7 +642,7 @@ pub struct CardFieldSettings { #[serde( rename = "additionalFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub additional_fields: Vec, @@ -657,7 +657,7 @@ pub struct CardFieldSettings { #[serde( rename = "coreFields", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub core_fields: Vec, @@ -746,7 +746,7 @@ pub struct CategoryConfiguration { #[serde( rename = "workItemTypes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_types: Vec, @@ -844,7 +844,7 @@ pub struct DeliveryViewData { #[serde( rename = "parentItemMaps", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub parent_item_maps: Vec, @@ -859,7 +859,7 @@ pub struct DeliveryViewData { #[doc = "All the team data"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub teams: Vec, @@ -867,7 +867,7 @@ pub struct DeliveryViewData { #[serde( rename = "workItemDependencies", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_dependencies: Vec, @@ -875,7 +875,7 @@ pub struct DeliveryViewData { #[serde( rename = "workItemViolations", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_violations: Vec, @@ -898,14 +898,14 @@ pub struct DeliveryViewPropertyCollection { #[doc = "Field criteria"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub criteria: Vec, #[doc = "Markers. Will be missing/null if there are no markers."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub markers: Vec, @@ -913,7 +913,7 @@ pub struct DeliveryViewPropertyCollection { #[serde( rename = "styleSettings", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub style_settings: Vec, @@ -921,7 +921,7 @@ pub struct DeliveryViewPropertyCollection { #[serde( rename = "tagStyleSettings", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub tag_style_settings: Vec, @@ -929,7 +929,7 @@ pub struct DeliveryViewPropertyCollection { #[serde( rename = "teamBacklogMappings", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub team_backlog_mappings: Vec, @@ -1159,7 +1159,7 @@ impl IdentityRef { pub struct IterationCapacity { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub teams: Vec, @@ -1190,7 +1190,7 @@ pub struct IterationWorkItems { #[serde( rename = "workItemRelations", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_relations: Vec, @@ -1271,7 +1271,7 @@ pub struct ParentChildWiMap { #[serde( rename = "childWorkItemIds", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub child_work_item_ids: Vec, @@ -1297,7 +1297,7 @@ pub struct ParentChildWiMapList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1411,7 +1411,7 @@ pub struct PlanList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1501,7 +1501,7 @@ pub struct PredefinedQuery { #[doc = "The results of the query. This will be a set of WorkItem objects with only the 'id' set. The client is responsible for paging in the data as needed."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub results: Vec, @@ -1531,7 +1531,7 @@ pub struct ProcessConfiguration { #[serde( rename = "portfolioBacklogs", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub portfolio_backlogs: Vec, @@ -1582,7 +1582,7 @@ pub struct ReorderOperation { #[doc = "IDs of the work items to be reordered. Must be valid WorkItem Ids."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub ids: Vec, @@ -1633,7 +1633,7 @@ pub struct ReorderResultList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1647,7 +1647,7 @@ impl ReorderResultList { pub struct Rule { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub clauses: Vec, @@ -1674,7 +1674,7 @@ pub struct TaskboardColumn { #[doc = "Work item type states mapped to this column to support auto state update when column is updated."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mappings: Vec, @@ -1713,7 +1713,7 @@ impl TaskboardColumnMapping { pub struct TaskboardColumns { #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub columns: Vec, @@ -1771,7 +1771,7 @@ pub struct TaskboardWorkItemColumnList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -1804,7 +1804,7 @@ pub struct TeamCapacity { #[serde( rename = "teamMembers", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub team_members: Vec, @@ -1905,7 +1905,7 @@ pub struct TeamFieldValues { #[doc = "Collection of all valid team field values"] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -1926,7 +1926,7 @@ pub struct TeamFieldValuesPatch { pub default_value: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub values: Vec, @@ -2016,7 +2016,7 @@ pub struct TeamMemberCapacityIdentityRefList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2070,7 +2070,7 @@ pub struct TeamSetting { #[serde( rename = "workingDays", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub working_days: Vec, @@ -2115,7 +2115,7 @@ pub struct TeamSettingsDaysOff { #[serde( rename = "daysOff", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub days_off: Vec, @@ -2130,7 +2130,7 @@ pub struct TeamSettingsDaysOffPatch { #[serde( rename = "daysOff", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub days_off: Vec, @@ -2168,7 +2168,7 @@ pub struct TeamSettingsIterationList { pub count: Option, #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub value: Vec, @@ -2214,7 +2214,7 @@ pub struct TeamSettingsPatch { #[serde( rename = "workingDays", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub working_days: Vec, @@ -2291,7 +2291,7 @@ pub struct TimelineTeamData { #[serde( rename = "fieldReferenceNames", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub field_reference_names: Vec, @@ -2308,7 +2308,7 @@ pub struct TimelineTeamData { #[doc = "The iteration data, including the work items, in the queried date range."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub iterations: Vec, @@ -2326,14 +2326,14 @@ pub struct TimelineTeamData { #[serde( rename = "partiallyPagedFieldReferenceNames", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub partially_paged_field_reference_names: Vec, #[serde( rename = "partiallyPagedWorkItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub partially_paged_work_items: Vec>, @@ -2344,7 +2344,7 @@ pub struct TimelineTeamData { #[serde( rename = "rollupWorkItemTypes", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub rollup_work_item_types: Vec, @@ -2368,7 +2368,7 @@ pub struct TimelineTeamData { #[serde( rename = "teamFieldValues", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub team_field_values: Vec, @@ -2376,7 +2376,7 @@ pub struct TimelineTeamData { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec>, @@ -2384,7 +2384,7 @@ pub struct TimelineTeamData { #[serde( rename = "workItemTypeColors", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_item_type_colors: Vec, @@ -2414,7 +2414,7 @@ pub struct TimelineTeamIteration { #[serde( rename = "partiallyPagedWorkItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub partially_paged_work_items: Vec>, @@ -2435,7 +2435,7 @@ pub struct TimelineTeamIteration { #[serde( rename = "workItems", default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub work_items: Vec>, @@ -2517,7 +2517,7 @@ pub struct UpdateTaskboardColumn { #[doc = "Work item type states mapped to this column to support auto state update when column is updated."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub mappings: Vec, @@ -2589,7 +2589,7 @@ pub struct WorkItem { #[doc = "Relations of the work item."] #[serde( default, - deserialize_with = "azure_core::util::deserialize_null_as_default", + deserialize_with = "crate::serde::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] pub relations: Vec, diff --git a/vsts-api-patcher/Cargo.lock b/vsts-api-patcher/Cargo.lock index 7e7cd988..0f5951d2 100644 --- a/vsts-api-patcher/Cargo.lock +++ b/vsts-api-patcher/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "json" @@ -31,9 +31,9 @@ checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "regex" -version = "1.11.1" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" dependencies = [ "aho-corasick", "memchr", @@ -43,9 +43,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "722166aa0d7438abbaa4d5cc2c649dac844e8c56d82fb3d33e9c34b5cd268fc6" dependencies = [ "aho-corasick", "memchr", diff --git a/vsts-api-patcher/src/patcher.rs b/vsts-api-patcher/src/patcher.rs index 4f8d2c61..a78d9144 100644 --- a/vsts-api-patcher/src/patcher.rs +++ b/vsts-api-patcher/src/patcher.rs @@ -826,6 +826,10 @@ impl Patcher { "autoCompleteSetBy": { "description": "If set, auto-complete is enabled for this pull request and this is the identity that enabled it.", "$ref": "#/definitions/IdentityRef" + }, + "completionOptions": { + "description": "Options which affect how the pull request will be merged when it is completed.", + "$ref": "#/definitions/GitPullRequestCompletionOptions" } } }, @@ -1038,11 +1042,11 @@ impl Patcher { // Excluded // administratorsGroup // operationStatus + // description r#"[ "authorization", "createdBy", "data", - "description", "id", "isReady", "isShared", @@ -1055,18 +1059,20 @@ impl Patcher { ( "serviceEndpoint.json", "ServiceEndpointProjectReference", + // Excluded: + // description + // name r#"[ - "description", - "name", "projectReference" ]"#, ), ( "serviceEndpoint.json", "ProjectReference", + // Excluded: + // name r#"[ - "id", - "name" + "id" ]"#, ), // ( @@ -1186,8 +1192,7 @@ impl Patcher { "git.json", "Change", r#"[ - "changeType", - "item" + "changeType" ]"#, ), ( @@ -1310,10 +1315,10 @@ impl Patcher { // Excluded // _links // url + // name + // pool r#"[ - "id", - "pool", - "name" + "id" ]"#, ), (